6.8. Testing SXPath

The sxpath example is a sketch of an SXPath testing tool. Unless you are a developer of an XPath implementation for SXML, you are not supposed to understand what happens in this example.

The example demonstrates how to use any XSLT stylesheet as a test case for an XPath implementation. The steps are the following.

Procedure 2. Making test using an XSLT stylesheet

  1. Using xslt2xsieve, convert the XSLT stylesheet to an XSieve stylesheet.

    The XSieve stylesheet uses x:eval function, which evaluates XPath through libxml.

  2. Change all x:eval to some other name, for example, sx:eval. Define the corresponding function, which evaluates XPath using an XPath implementation under testing.

  3. Run the original XSLT stylesheet, run the final XSieve stylesheet. The results should be equal.

The sxpath example tests the txpath implementation. The source XML and XSLT are taken from the xslt2xsieve example. To run the test, enter the example/sxpath directory and execute the following command.

$ make check