-
Notifications
You must be signed in to change notification settings - Fork 6
DocBookXsltExtensions
Extensions for Saxon and Xalan
The DocBook Saxon Extensions and DocBook Xalan Extensions are sets of DocBook-specific XSLT 1.0 extensions created by NormanWalsh for performing a variety of tasks:
- Embed callouts in verbatim environments (program listings, for example)
- Add line numbers to verbatim environments (program listings, for example)
- Adjust the width of table columns in HTML output to match specs in the CALS table source
- Directly include contents of a text file in rendered output
- Determine the intrinsic size of an image
The above tasks are either impractical or impossible to implement with standard XSLT 1.0 only.
The extensions are written in Java and they can be used with Xalan-Java and Saxon extensions. For specific how-to instructions on using them, see the DocBook Xalan extensions and DocBook XSL: The Complete Guide sections in http://www.sagehill.net/docbookxsl/ .
Basically, to use the extensions, you need to:
- determine which extension jar file (in the
extensionsdirectory in the DocBookXslStylesheets distribution) corresponds most closely to the Java XSLT engine you use - include the name of that jar file in your Java classpath
- set the correct XSLT extension parameters to enable the behavior you need. Here is documentation for the parameters for HTML output.
For example, if you are using Saxon 6.5.3, include the extensions/saxon65.jar file
in your Java classpath, and (at a minimum) set the value of the
use.extensions
parameter to 1 (instead of the default 0).
There is no complete set of extensions that will work with the libxslt library (which is written in C and includes the xsltproc command line tool).
Currently, there is one libxslt extension: a Python implementation of a function that adjusts column-widths in CALS tables. See README.LIBXSLT for more information.