Next / Previous / Contents / NM Tech homepage

7.4. HTML section and subsection headings

All of the local customizations of section headings can be done by setting XSLT variables.

Turn on section numbering, so that each section and subsection has a number such as 3.1.4 that identifies where it fits into the overall structure.

zdp_html.xsl
<!--Prepend the chapter number to section numbers-->
<xsl:param name="section.label.includes.component.label" select="1"/>

<!--section.autolabel: Use X.X.X section numbering-->
<xsl:param name="section.autolabel" select="1"/>

We set the chunk.quietly variable to suppress messages that would normally be written as each chunk is generated.

zdp_html.xsl
<!--chunk.quietly: Don't log the name of each chunk-->
<xsl:param name="chunk.quietly" select="1"></xsl:param>

The use.id.as.filename variable instructs XSLT to use each section's id attribute as its file name. Without this variable, chunk file names are assigned according to section numbering, but this means any changes in the section structure change the file names of chunks. With the variable set, for example “<section id='foo'>” will be placed in a file named foo.html. This makes it easier for external documents to link to specific locations in the HTML structure.

zdp_html.xsl
<!--use.id.as.filename: Use the chunk's id as its filename-->
<xsl:param name="use.id.as.filename">1</xsl:param>