XSLT is now a mature technology. It's widely used in web, document composition, electronic and print publishing applications, among others. Increasingly, XSLT styling isn't the last little bit at the end to create the HTML, but at the core of document creation and processing pipelines. Indeed it isn't uncommon, particularly in publishing applications, to have multiple XSLT transformation steps chained one after the other. XSLT stylesheets are getting larger and more complex, containing significant chunks of business logic.

XSLT, while addressing the specific issue transforming XML, is Turing complete. It's a real programming language, and people are doing real work with it.

Development is easier with automated testing. It's a given. That's why Ant integrates JUnit, and why C++ programmers up and down the land spend hours developing test harnesses because CppUnit just isn't quite right.

How do you test an XSLT stylesheet?

I'd like to present a tool for XSLT testing. Tests are described in an XML vocabulary. The test definitions are cranked through a set of XSLT stylesheets to generate Java source, more XML and yet more XSLT. The Java sources are JUnit test suites which drive the XSLT test procedure. It's all stitched together with Ant.

It's all quite neat from an exposition point of view. It's an application written in more or less equal parts of Java and XSLT. It uses multiple XSLT stages. It needs testing too :) While the code I have is in Java, it can be adapted to C#, C++ or any language where you have an XSLT processor and test harness available.