Search code examples
xmlcompare

Compare XML ignoring order of child elements


Does anybody know of a tool that will compare two XML documents. Belay that mocking… there’s more. I need something that will make sure each node in file 1 is also in file 2 regardless of order. I thought XML Spy would do it with the Ignore Order of Child Nodes option but it didn’t. The following would be considered the same:

<Node>
    <Child name="Alpha"/>
    <Child name="Beta"/>
    <Child name="Charlie"/>
</Node>

<Node>
    <Child name="Beta"/>
    <Child name="Charlie"/>
    <Child name="Alpha"/>
</Node>

Solution

  • You might want to google for "XML diff tool", which will give you more than adequate results. One of them is OxygenXml, a tool I frequently use. You can also try Microsofts XML Diff and Patch Tool.

    Good Luck.