XML technologies / DocBook / The DocBook XSL stylesheets / Customizing DocBook XSL stylesheets / Passing parameters through the XSLT processor

(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)

Every XSLT processor provides an option to override stylesheet parameters. This has the following advantages:

For example, to link an HTML file to a CSS file, use the parameter html.stylesheet. For xsltproc:

xsltproc --stringparam html.stylesheet "user.css" ... 

For Saxon use the following syntax:

saxon ... html.stylesheet="'user.css'"

Saxon expects parameters in single quotes, interpreted as strings. If several parameters are needed, specify each as a Parameter=Wert expression. For xsltproc use the option for strings --stringparam or, for numeric values, the option --param. Confusing these options may pass a number as a string, producing unwanted results.

This method also lets you pass several parameters to the stylesheet. Too many become unwieldy, however, so a customization file is preferable.

  

back to top