I am looking for a diff tool that allows me to compare 2 xml (or json) files ignoring the order of its elements.
Example:
<Node>
<Child name="Alpha"/>
<Child name="Beta"/>
<Child name="Charlie"/>
</Node>
<Node>
<Child name="Beta"/>
<Child name="Charlie"/>
<Child name="Alpha2"/>
</Node>
The 2 Node elements should be considered similar and the only difference to be shown is that Node1 has a child name "Alpha" which is "Alpha2" in the other node.
StackOverflow has a similar question, but it was asked 8 years ago, the solution no longer works. Is there a newer tool available?
Depending on the size of XML use a diff tool with an adjustable skew tolerance - how far the algorithm would look for "similar" lines - and closeness matching.
"Naive" diff using Beyond Compare 4:
With closeness matching:
This works very well when merging, say, Visual Studio *.sln files (XML) with thousands of lines :)
If that's not enough, there's an option for "XML Sort" conversion that applies a sorting XSLT to inputs.
Regular diff:
With "XML Sort" conversion:
Where to apply it from:
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