wiki:TestingXSLT/UTF-X

Unit Testing Framework – XSLT (UTF-X)

UTF-X, available from  http://utf-x.sourceforge.net/, is a Java-based framework where tests can be run from the command line, from an Ant build file, or using JUnit. Tests are written as XML. The following example from from the UTF-X web site asserts that the result of processing the content of the utfx:source element will match the content of the utfx:expected element.

<utfx:test>
  <utfx:name>sect1 with title only</utfx:name>
  <utfx:assert-equal>
    <utfx:source validate="yes">
      <section id="section1">
        <heading>Section 1</heading>
      </section>
    </utfx:source>
    <utfx:expected validate="yes">
      <a name="section1" />
      <h1>Section 1</h1>
    </utfx:expected>
  </utfx:assert-equal>
</utfx:test>

UTF-X includes a test generator that can generate a test definition file for an existing stylesheet.