XML technologies / DocBook / Generating (X)HTML / Generating tables of contents / Excluding elements from the table of contents

(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)

To exclude certain structural-element titles from the table of contents, use this approach: set the role attribute of the relevant element to NoToc and add a short template rule:

<xsl:template match="sect1[@role='NoToc']" mode="toc"/>

This template rule matches all sect1 elements in mode toc. The DocBook stylesheets generate a title for all elements containing mode="toc". In the example above, the template rule is empty, so no title and therefore no table-of-contents entry is generated.

  

back to top