InfoQ has published an article of mine titled Unit-Testing XML.

In this article I describe the four major use-cases for XMLUnit (my subjective view, YMMV): validation (against DTD or XSD), comparing XML snippets, XPath tests and programmatic validations. I don't cover testing HTML at all.

The article is written for XMLUnit 1.1 which is due to see its final release pretty soon (we released our second beta about two weeks ago). All examples of the article focus on using XMLUnit via its API, so it should be pretty easy to adapt them to use TestNG, JUnit 4 or whatever else you use to run your tests.

I could only touch on some of the more advanced issues, in particular I briefly show how to fine tune the inner workings of the difference engine by providing DifferenceListeners or ElementQualifiers.

path: /en/oss/XMLUnit | #