Chapter 15. Using XSL Stylesheets

Currently using XSL stylesheets to generate output of XML files is not as well supported as using DSSSL style sheets. This is because XSL stylesheets are not as customized as DSSSL ones, and XSL tools are not as widely used, and standardized.

At this time there are no XSL specific targets in Makefile. This is because there are not standardized ways to invoke XSLT processors. To use XSL stylesheets you must run the configure script and tell it, where your copy of XSL DocBook Stylesheets is placed. The majority of XSLT processors require an URL instead of a filename, so be sure to prepend the file:/// schema before path:

$ autoconf
$ ./configure --with-xsl=file:///path/to/docbook/xsl/styles

Configure will create four files: html.xsl, bightml.xsl, htmlhelp.xsl, print.xsl among others. These files can be used to generate the desired output. html.xsl generates a set of small HTML files, bightml.xsl generates one large HTML file, htmlhelp.xsl generates source files processable by HTML Help Workshop and print.xsl generates a file with FO objects suitable for further processing with some FO processor.

Invocation of XSLT processor is processor dependent, for now suppose that you have a shell script called saxon which is able to invoke the Saxon processor. Some examples:

$ mkdir html
$ saxon manual.xml html.xsl
$ saxon manual.xml htmlhelp.xsl
$ saxon -o bigmanual.html manual.xml bightml.xsl
$ saxon -o manual.fo manual.xml print.xsl

Use the appropriate command from the examples above to generate the desired output as described above. If you would like to generate HTML Help output, you must run the Microsoft HTML Help Compiler after processing. To get a PDF from the FO file, you must run some FO processor on the manual.fo file.

Note: Generating bigmanual.html with Saxon (using JDK 1.3) takes about two minutes on a Celeron 400 computer. Generating FO files takes about two times more + plus time required to run the FO processor. Generating chunked version or HTML Help version of manual takes about 60 minutes.

Note: Not all customization from DSSSL are backported to XSL, so some things are not as pretty as in DSSSL output currently.