In order to do this, you need to use a custom XSLT style sheet instead of the stock one. Of course, the custom XSLT style sheet includes the stock one, so you can concentrate on your customizations.
Once you have created your custom XSLT style sheet, you have to specify to XXE that it must use it instead on the stock one. This is done by the means of a system property having the proper name and value.
Copy one of the following template files depending on which configuration you want to customize and on which format you want to generate:
Configuration Name | Convert to | Procedure |
---|---|---|
DocBook v5+ | HTML multi-page | Copy chunk.xsl to |
HTML single page | Copy html.xsl to | |
HTML Help | Copy htmlhelp.xsl to | |
Java Help | Copy javahelp.xsl to | |
Eclipse Help | Copy eclipse.xsl to | |
RTF, WordprocessingML, OpenDocument, OOXML | Copy fo.xsl to | |
PDF, PostScript | Copy fo.xsl to | |
DocBook | HTML multi-page | Copy chunk.xsl to |
HTML single page | Copy html.xsl to | |
HTML Help | Copy htmlhelp.xsl to | |
Java Help | Copy javahelp.xsl to | |
Eclipse Help | Copy eclipse.xsl to | |
RTF, WordprocessingML, OpenDocument, OOXML | Copy fo.xsl to | |
PDF, PostScript | Copy fo.xsl to | |
XHTML Strict XHTML Transitional | RTF, WordprocessingML, OpenDocument, OOXML | Copy fo.xsl to |
PDF, PostScript | Copy fo.xsl to |
For example, DocBook v5+ chunk.xsl
looks like this:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:d="http://docbook.org/ns/docbook" version="1.0" exclude-result-prefixes="d"> <xsl:import href="xxe-config:docbook5/xsl/html/chunk.xsl"/> </xsl:stylesheet>
Edit this file using an XML or text editor and add one or more XSLT elements after the xsl:import
element.
DocBook html.xsl
example: Use the UTF-8 encoding instead of default ISO-8859-1 when converting a DocBook document to single page HTML[10]:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:import href="xxe-config:docbook/xsl/html/docbook.xsl"/> <xsl:output method="html" encoding="UTF-8" indent="no" saxon:character-representation="native;decimal"/> </xsl:stylesheet>
DocBook fo.xsl
example: add more information to the title page of book:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> <xsl:import href="xxe-config:docbook/xsl/fo/docbook.xsl"/> <xsl:template match="bookinfo/author|info/author" mode="titlepage.mode"> <fo:block> <xsl:call-template name="anchor"/> <xsl:call-template name="person.name"/> <xsl:if test="affiliation/orgname"> <fo:block> <xsl:apply-templates select="affiliation/orgname" mode="titlepage.mode"/> </fo:block> </xsl:if> <xsl:if test="email|affiliation/address/email"> <fo:block> <xsl:apply-templates select="(email|affiliation/address/email)[1]"/> </fo:block> </xsl:if> </fo:block> </xsl:template> </xsl:stylesheet>
Add one of the following property configuration element to your custom .xxe
file:
Configuration Name | Convert to | Property Configuration Element |
---|---|---|
DocBook v5+ | HTML multi-page | <property name="db5.toHTML.transform" url="true">chunk.xsl</property> |
HTML single page | <property name="db5.toHTML1.transform" url="true">html.xsl</property> | |
HTML Help | <property name="db5.toHTMLHelp.transform" url="true">htmlhelp.xsl</property> | |
Java Help | <property name="db5.toJavaHelpStep1.transform" url="true">javahelp.xsl</property> | |
Eclipse Help | <property name="db5.toEclipseHelp.transform" url="true">eclipse.xsl</property> | |
RTF, WordprocessingML, OpenDocument, OOXML | <property name="db5.toRTF.transform" url="true">fo.xsl</property> | |
PDF, PostScript | <property name="db5.toPS.transform" url="true">fo.xsl</property> | |
DocBook | HTML multi-page | <property name="docb.toHTML.transform" url="true">chunk.xsl</property> |
HTML single page | <property name="docb.toHTML1.transform" url="true">html.xsl</property> | |
HTML Help | <property name="docb.toHTMLHelp.transform" url="true">htmlhelp.xsl</property> | |
Java Help | <property name="docb.toJavaHelpStep1.transform" url="true">javahelp.xsl</property> | |
Eclipse Help | <property name="docb.toEclipseHelp.transform" url="true">eclipse.xsl</property> | |
RTF, WordprocessingML, OpenDocument, OOXML | <property name="docb.toRTF.transform" url="true">fo.xsl</property> | |
PDF, PostScript | <property name="docb.toPS.transform" url="true">fo.xsl</property> | |
XHTML Strict XHTML Transitional | RTF, WordprocessingML, OpenDocument, OOXML | <property name="xhtml.toRTF.transform" url="true">fo.xsl</property> |
PDF, PostScript | <property name="xhtml.toPS.transform" url="true">fo.xsl</property> |