6.7. DocBook XSieve stylesheets

DocBook XSL stylesheets are a set of big and complex XSLT programs, which convert DocBook documents to other formats, such as HTML or PDF. The documentation you are reading now is written using DocBook.

The DocBook XSL stylesheets probably use all features of the XSLT language. They can be used as an etalon test. If an XSLT processor interprets the stylesheets right, then it is a good and mature XSLT processor.

Using the xslt2xsieve converter, we can generate an XSieve version of the DocBook stylesheets. A resulting DocBook XSieve stylesheets are a set of big and complex XSieve programs. If they work correctly, then an XSieve processor can be considered as good and mature.

The following test plan is used to test XSieve:

The corresponding test is implemented, but it never runs automatically. Instead, if you want to run the test, you have to perform the following actions manually.

Procedure 1. Testing XSieve using DocBook stylesheets

  1. In the file config/xsieve.mk, check the value of the variable dbstyleroot. The value should point to a directory with the DocBook XSL stylesheets.

  2. In the directory example/xslt2xsieve, say:

    $ make docbook

    Upon successful conversion, the directory docbook contains DocBook XSieve stylesheets.

  3. (Optional) In the directory doc/book, say:

    $ make xsieve-html

    HTML is generated using XSieve. The source DocBook file is xsieve.xml, which is also the source of this document. The result is in the directory xsieve-html-dir.

  4. In the directory doc/book, say:

    $ make xsieve-check

    Unless already exist, HTML files are generated using XSLT and XSieve, and the results are compared.

    Actually, the raw results are not equal. The stylesheets use XSLT functions like generate-id, which returns different results between runs. Therefore, before comparing, HTML is modified a bit using a Perl script.

XSieve passes the test, so it is considered to be quite stable.