![]() ![]() But it’s a very simple little tool, and was good enough for my purposes tonight! It’s a quick hack to let me compare a handful of files, so it’s not been rigorously tested. The source showing how this works is available in a gist at $ python xmldiff.py vsdiff testA.xml testB.xml $ python xmldiff.py diffmerge testA.xml testB.xml My approach works with either of these.) Exampleįor example, consider the following simple test files: (On Windows, I prefer vsdiff from SlickEdit. Instead, to compare two of my XML files, my approach is to sort them both so they have a consistent order, and then diff the sorted files using an existing visual diff tool. So I wrote a bit of Python to do it for me.ĭiff tools are complex, and I’m in a hurry without time to implement one. I needed to compare some large XML files, which have big differences in the order of elements, and I couldn’t find a tool that would do the job. Similarly, the order of the attributes within each element isn’t significant.įor example, for my purposes, these two XML files are equivalent: The XML is being used to contain a set of things, not a list – the order of the elements has no significance. ![]() For these particular XML files, order is not important.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |