XML technologies / DocBook / The DocBook XSL stylesheets / Customizing DocBook XSL stylesheets / How to customize the DocBook stylesheets

(Excerpt from "DocBook-XML: Medienneutrales und plattformunabhängiges Publizieren" by Thomas Schraitle)

The previous sections showed how to introduce changes into the stylesheets, but not the general workflow. The following instructions describe a general approach to customizing the DocBook stylesheets:

  1. Which DocBook version?
    First establish which DocBook version you are writing in. Choose your customization file as shown in A customization file for the DocBook stylesheets.

  2. Checking existing parameters
    Before customizing templates, check whether your problem can be solved with the existing parameters in DocBook XSL Stylesheets: Reference Documentation.

  3. Copying from the original
    If parameters do not help, first identify the relevant template. For example, to customize the element command, search for it in the DocBook stylesheets; you will find it in the file inline.xsl.

  4. Adding the changes
    Copy the template you found into your customization file and modify it as required.

  5. Consult DocBook XSL: The Complete Guide
    If you get stuck, look for a solution in Bob Stayton’s book.

  6. Test your customization
    Check whether your template is called by outputting a diagnostic message with xsl:message.

In the author’s experience, the following practices have proved useful when customizing the DocBook stylesheets:

  

back to top