Free since 2005 · No login required
AT

Academic Tutorials

Learn at your own pace

site-mobile-top-banner · 320x50

Parameterization

Added 26 Jul 2008

The vast majority of stylesheet users aren't XSLT programmers. This means that parameters (simple assignment-level statements) need to be provided wherever possible for the customizations that most users need to perform.

For DocBook, this is a veritable laundry list of features: should chapters, sections, figures, tables, etc. be numbered; should admonitions use graphics; should tables of contents be generated for books, chapters, articles, etc.; what spacing should be used around elements; etc. At last count there were more than 70 parameters each in the HTML and Formatting Object Stylesheets.

This requires slightly more effort on the part of the maintainer, but the rewards are obvious. It is vastly easier to explain to someone that all they need to do to get numbered sections is add section.autolabel=1 to the command that runs their XSLT processor than it would be to explain how to modify the template that generates section labels.

Even explaining how to set several parameters by writing a custom stylesheet is fairly easy since it's mostly boiler plate:

                version="1.0">







But even this becomes cumbersome if the author wishes to change more than a few parameters. The clever solution[2] to this problem is to use a web form (and perhaps one day a simple Java application) to allow authors to choose the parameters that they want to use. Then the customization layer can be built automatically.