2.5. Custom parameters for the XSLT style sheet used to convert DocBook documents to RTF, PostScript and PDF

Named parameterGroups are used here to customize the HTML files generated using sub menu Convert of the DocBook menu (see XXE_install_dir/addon/config/docbook/xslMenu.incl)

Which parameterGroups to use for DocBook is described in another document: Customizing the XSL style sheets used by the above Convert commands in XMLmind XML Editor - DocBook Support.

The reference manual of Norman Walsh's DocBook XSLT style sheets (which is needed to know, for instance, what means "chunker.output.encoding") is found in another document: DocBook XSL Stylesheet Documentation.

  <!-- Use UTF-8 encoding for generated multi-page HTML. -->

  <parameterGroup name="docb.toHTML.transformParameters">
    <parameter name="chunker.output.encoding">UTF-8</parameter>
    <parameter name="saxon.character.representation">native;decimal</parameter>
  </parameterGroup>

2.5.1. Extensively customizing the conversion process

It is also possible to extensively customize the Convert commands by specifying alternate XSLT style sheets for them.

Example: defining the following property in any XXE configuration file (see configuration element property) allows to use customized XSLT style sheet mydocbook.xsl instead of the one normally used by the docb.toHTML1 process command:

<property name="docb.toHTML1.transform" url="true">mydocbook.xsl</property>

The customized XSLT style sheet always imports the stock style sheet and generally redefines a few custom templates.

<?xml version='1.0' encoding="UTF-8"?>
<xsl:stylesheet version="1.0"  
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
                xmlns:saxon="http://icl.com/saxon"
                extension-element-prefixes="saxon">

  <xsl:import href="xxe-config:docbook/xsl/html/docbook.xsl"/>1

  <xsl:output method="html" 
              encoding="UTF-8"2
              indent="no" 
              saxon:character-representation="native;decimal"/>
</xsl:stylesheet>

In the above example (mydocbook.xsl), the goal is to generate single-page HTML files using the UTF-8 encoding instead of ISO-8859-1.

1

Imports the stock XSLT style sheet used to create single-page HTML files. Note the "xxe-config:"-style URL.

2

The above example does not redefine templates. It redefines the xsl:output element of the style sheet.

Another example is found in the documentation of the process/transform configuration element. See Section 1.5, “Element transform” in XMLmind XML Editor - Commands.

Tip

In our opinion, it is almost impossible to cope with the complexity of customizing Norman Walsh's DocBook XSLT style sheets without reading this excellent book: DocBook XSL: The Complete Guide by Bob Stayton.