{"action":"created","issue":{"url":"https://api.github.com/repos/xmlunit/xmlunit/issues/122","repository_url":"https://api.github.com/repos/xmlunit/xmlunit","labels_url":"https://api.github.com/repos/xmlunit/xmlunit/issues/122/labels{/name}","comments_url":"https://api.github.com/repos/xmlunit/xmlunit/issues/122/comments","events_url":"https://api.github.com/repos/xmlunit/xmlunit/issues/122/events","html_url":"https://github.com/xmlunit/xmlunit/issues/122","id":324503409,"number":122,"title":"Compare 2 XMLs with nested elements and un-ordered","user":{"login":"bensam000","id":39416438,"avatar_url":"https://avatars3.githubusercontent.com/u/39416438?v=4","gravatar_id":"","url":"https://api.github.com/users/bensam000","html_url":"https://github.com/bensam000","followers_url":"https://api.github.com/users/bensam000/followers","following_url":"https://api.github.com/users/bensam000/following{/other_user}","gists_url":"https://api.github.com/users/bensam000/gists{/gist_id}","starred_url":"https://api.github.com/users/bensam000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bensam000/subscriptions","organizations_url":"https://api.github.com/users/bensam000/orgs","repos_url":"https://api.github.com/users/bensam000/repos","events_url":"https://api.github.com/users/bensam000/events{/privacy}","received_events_url":"https://api.github.com/users/bensam000/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-18T18:07:43Z","updated_at":"2018-05-18T18:32:37Z","closed_at":null,"author_association":"NONE","body":"Hi Guys - I want to compare 2 xmls that have nested elements. \r\n\r\nControl XML\r\n```\r\n\r\n<books>\r\n    <book>\r\n        <tr>mark</tr>\r\n    </book>\r\n    <book>\r\n        <tr>sam</tr>\r\n    </book>\r\n</books>\r\n\r\n```\r\nTEST\r\n\r\n```\r\n<books>\r\n    <book>\r\n        <tr>mark</tr>\r\n    </book>\r\n\r\n>     <book>\r\n>         <tr>tim</tr>\r\n>     </book>\r\n\r\n    <book>\r\n        <tr>sam</tr>\r\n    </book>\r\n</books>\r\n```\r\n\r\nFrom the above sample xml's, I would like to differences only for the new xml block that's added.\r\nI tried using the ElementSelectors byNameandText and other combinations. However, am getting more differences that what I would like.\r\n\r\nOptions Tried\r\n\r\n```\r\nElementSelectors.conditionalBuilder()\r\n\t    .whenElementIsNamed(\"books\")\r\n\t    .thenUse(ElementSelectors.byXPath(\"./book\", ElementSelectors.byNameAndText))\r\n\t    .elseUse(ElementSelectors.byName)\r\n\t    .build();\r\n\t\t\r\nElementSelectors.or(ElementSelectors.byName,\t  \r\n\t\t\t\t\tElementSelectors.byNameAndText,\r\n\t\t\t\t\tElementSelectors.byNameAndAllAttributes)\t\t\r\n\r\nExpected child nodelist length '2' but was '3' - comparing <books...> at /books[1] to <books...> at /books[1] (DIFFERENT), \r\nExpected text value 'sam' but was 'tim' - comparing <tr ...>sam</tr> at /books[1]/book[2]/tr[1]/text()[1] to <tr ...>tim</tr> at /books[1]/book[2]/tr[1]/text()[1] (DIFFERENT), \r\nExpected child 'null' but was 'book' - comparing <NULL> to <book...> at /books[1]/book[3] (DIFFERENT)\r\n```\r\n\r\n\r\nIs there some other ElementSelectors option thats out there byNameAndXML\r\n"},"comment":{"url":"https://api.github.com/repos/xmlunit/xmlunit/issues/comments/390294449","html_url":"https://github.com/xmlunit/xmlunit/issues/122#issuecomment-390294449","issue_url":"https://api.github.com/repos/xmlunit/xmlunit/issues/122","id":390294449,"user":{"login":"bensam000","id":39416438,"avatar_url":"https://avatars3.githubusercontent.com/u/39416438?v=4","gravatar_id":"","url":"https://api.github.com/users/bensam000","html_url":"https://github.com/bensam000","followers_url":"https://api.github.com/users/bensam000/followers","following_url":"https://api.github.com/users/bensam000/following{/other_user}","gists_url":"https://api.github.com/users/bensam000/gists{/gist_id}","starred_url":"https://api.github.com/users/bensam000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bensam000/subscriptions","organizations_url":"https://api.github.com/users/bensam000/orgs","repos_url":"https://api.github.com/users/bensam000/repos","events_url":"https://api.github.com/users/bensam000/events{/privacy}","received_events_url":"https://api.github.com/users/bensam000/received_events","type":"User","site_admin":false},"created_at":"2018-05-18T18:32:37Z","updated_at":"2018-05-18T18:32:37Z","author_association":"NONE","body":"Sorry Folks, if this is not a FORUM for discussion. Was not sure where to ask the question, so posted it here"}}
{"actor":{"display_login":"bensam000"}}