I need to compare two XML files, each of which is about 13,000 lines long.
Sadly the code that generates these files doesn't generate the data in the same order each time (the data comes from a database).
Therefore, I get false positives when using a standard line-by-line diff utility (WinMerge), even after canonicalising the XML file.
As an example of my problem:
file1:
<a>
<b key="fruit.preferred">banana</b>
<b key="fruit.available">pineapple</b>
<b key="fruit.available">apple</b>
<b key="fruit.available">orange</b>
</a>
file2:
<a>
<b key="fruit.available">pineapple</b>
<b key="fruit.preferred">banana</b>
<b key="fruit.available">apple</b>
<b key="fruit.available">orange</b>
</a>
These files are have the same content, but the position of the banana line means that they are considered different by traditional diff. Are there any tools that can perform a sort such that the files are considered the same?
By the way, the XML file structures are more complicated than the examples above!