We use a number of XSL transformations in the project, and have developed a method for applying test cases to these using pure XSL. The test cases are encoded in XML and processed using a set of XSL transformations.
Please take a moment to read the disclaimer and the copyright notice
XSL transformation testing
Description
Test case coding is done in three steps:
- code test cases in Higgins Test XML
- code a small XSL wrapper for the XSL test processing code to launch the tests
- apply the wrapper to the Test XML using an XSL processor (currently MSXML, but the code can easily be altered to work with Xalan or Saxon instead).
The wrapper is used to let the tests run on the appropriate templates. It also specifies whether the test results should be given as XML, HTML or text (suitable for Perl test code).
Code and examples
- Examples of test suits and the XML specification
- process_xslt_tests.xslt - main XSL wrapper
- process_tests/core.xslt - XSL processing core
- process_tests/test2html_fragment.xslt - core Test XML to HTML transformations
- set_expressions_test.xslt - example wrapper for tests of some set expressions (the wrapper is used with the example provided with the Test XML specification)
Copyright © 2002-2004 Jens Edlund, Gabriel Skantze and the members of the Center for Speech Technology