I came across the need to compare two XML trees for equality in unit tests I’m writing for a project you’ll hopefully hear about soon. I started to write a tree-walking comparer then thought I’d google around to see if anyone had done this for me. simplexmldiff is a clever script that just reads in two XML docs, pretty prints them, and then diffs their output. Brilliant. It isn’t perfectly accurate due to whitespace, but I don’t care about that for this project. I reimplemented what I needed of it in 4 lines of python. hellah.
Leave a Reply