wrote:
> It seems it wouldn't be possible without transforming both
> files (unless you're willing to write a tool for comparing
> them in XSLT).
Or in another programming language, eg by using a SAX or DOM parser and
writing a parallel tree-walker that understands which differences are
meaningful and which aren't.
Note that a text diff is often not the right tool anyway, because there
are things which XML itself doesn't consider meaningful -- order of
attributes, whitespace in some places, that sort of thing. So if you're
doing a serious test suite, you usually wind up having to write some
special-purpose code anyway, or find something you can swipe for the
purpose.
For example: You might want to look at the compare code used in the
Xalan processor's regression test suite, and either adapt that to also
ignore the things you don't consider meaningful or (as Pavel suggested)
preprocess those away before comparing. Another approach I've seen
(which again would require preprocessing) involved canonicalizing the
two documents (which theoretically suppresses most or all of the
insignificant differences) and then doing a text diff against the results.
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry