{"action":"closed","issue":{"url":"https://api.github.com/repos/rodrigozc/xmlx/issues/7","repository_url":"https://api.github.com/repos/rodrigozc/xmlx","labels_url":"https://api.github.com/repos/rodrigozc/xmlx/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/rodrigozc/xmlx/issues/7/comments","events_url":"https://api.github.com/repos/rodrigozc/xmlx/issues/7/events","html_url":"https://github.com/rodrigozc/xmlx/issues/7","id":185973870,"number":7,"title":"Parser fails when children elements has same name than parent","user":{"login":"rodrigozc","id":378062,"avatar_url":"https://avatars.githubusercontent.com/u/378062?v=3","gravatar_id":"","url":"https://api.github.com/users/rodrigozc","html_url":"https://github.com/rodrigozc","followers_url":"https://api.github.com/users/rodrigozc/followers","following_url":"https://api.github.com/users/rodrigozc/following{/other_user}","gists_url":"https://api.github.com/users/rodrigozc/gists{/gist_id}","starred_url":"https://api.github.com/users/rodrigozc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodrigozc/subscriptions","organizations_url":"https://api.github.com/users/rodrigozc/orgs","repos_url":"https://api.github.com/users/rodrigozc/repos","events_url":"https://api.github.com/users/rodrigozc/events{/privacy}","received_events_url":"https://api.github.com/users/rodrigozc/received_events","type":"User","site_admin":false},"labels":[{"id":467862288,"url":"https://api.github.com/repos/rodrigozc/xmlx/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-28T17:08:47Z","updated_at":"2016-11-01T02:54:52Z","closed_at":"2016-11-01T02:54:52Z","body":"Parser fails when children elements has same name than parent.\n\nError example, xml with searchResponse inside searchResponse element:\n\n``` elixir\n\"\"\"\n<?xml version=\"1.0\"?>\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:sam=\"http://www.example.org/sample/\">\n  <soapenv:Header/>\n  <soapenv:Body>\n    <sam:searchResponse>\n      <sam:searchResponse>\n        <item>\n          <id>1234</id>\n          <description><![CDATA[<item><width>123</width><height>345</height>\n<length>098</length><isle>A34</isle></item>]]></description>\n          <price>123</price>\n        </item>\n      </sam:searchResponse>\n    </sam:searchResponse>\n  </soapenv:Body>\n</soapenv:Envelope>\n\"\"\" |> Xmlx.parse\n```\n\nResult:\n\n```\n** (FunctionClauseError) no function clause matching in Keyword.get/3\n    (elixir) lib/keyword.ex:150: Keyword.get(nil, :item, nil)\n      (xmlx) lib/xmlx/parser.ex:122: Xmlx.Parser.put/8\n      (xmlx) lib/xmlx/parser.ex:68: Xmlx.Parser.build/4\n```\n\nSuccess example, inner searchResponse element renamed to searchResponse2:\n\n``` elixir\n\"\"\"\n<?xml version=\"1.0\"?>\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:sam=\"http://www.example.org/sample/\">\n  <soapenv:Header/>\n  <soapenv:Body>\n    <sam:searchResponse>\n      <sam:searchResponse2>\n        <item>\n          <id>1234</id>\n          <description><![CDATA[<item><width>123</width><height>345</height>\n<length>098</length><isle>A34</isle></item>]]></description>\n          <price>123</price>\n        </item>\n      </sam:searchResponse2>\n    </sam:searchResponse>\n  </soapenv:Body>\n</soapenv:Envelope>\n\"\"\" |> Xmlx.parse\n```\n\nResult:\n\n```\n[Envelope: [__namespace__: \"http://schemas.xmlsoap.org/soap/envelope/\",\n  Header: [__namespace__: \"http://schemas.xmlsoap.org/soap/envelope/\"],\n  Body: [__namespace__: \"http://schemas.xmlsoap.org/soap/envelope/\",\n   searchResponse: [__namespace__: \"http://www.example.org/sample/\",\n    searchResponse2: [__namespace__: \"http://www.example.org/sample/\",\n     item: [id: [text: \"1234\"],\n      description: [text: \"<![CDATA[<item><width>123</width><height>345</height><length>098</length><isle>A34</isle></item>]]>\"],\n      price: [text: \"123\"]]]]]]]\n```\n"}}
{"actor":{"display_login":"rodrigozc"}}