Chapter 1. XSLT Standard Library Test Suite

Steve Ball

Table of Contents

About The Test Suite
Preparing The Tests
Running The Tests
Debugging mode

About The Test Suite

This stylesheet tests the stylesheet modules contained in the XSLT Standard Library

Preparing The Tests

The tests are performed using the stylesheet test.xsl. Normally this stylesheet is supplied with the XSLTSL distribution, so you shouldn't need to do anything.

However, if you have added a new stylesheet module to the library then the test.xsl stylesheet must be regenerated. This is done using the gentest.xsl stylesheet. To do this, process the test.xml file with the stylesheet gentest.xsl using your favourite XSLT processor.

Running The Tests

Process the test.xml file with the stylesheet test.xsl using your favourite XSLT processor. The result is an XML document. You can process this with the results.xsl stylesheet to get formatted html output. A modern browser combined with the results.css file gives you green lines for the tests that passed and ugly red ones for the ones that didn't. When the tests fail they also print a text message to the console for quick verification of the correctness.

Debugging mode

When a test seems to be stuck in a loop or if you want to verify the tests in some other way, start the test.xsl stylesheet with the parameter debug='true' to get more info printed to the console.