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>
In the most general sense, XML element order does not matter, unless otherwise specified by the appropriate schema.
Just drag and drop the files you want to compare and select the option as compare with selected.
I wrote a simple python tool for this called xmldiffs
:
Compare two XML files, ignoring element and attribute order.
Usage:
xmldiffs [OPTION] FILE1 FILE2
Any extra options are passed to the
diff
command.
Get it at https://github.com/joh/xmldiffs
With Beyond Compare you can use in the File Formats
-Settings the XML Sort
Conversion. With this option the XML children will be sorted before the diff.
A trial / portable version of Beyond Compare is available.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With