diff options
Diffstat (limited to 'xhtml/autotoc.xsl')
-rw-r--r-- | xhtml/autotoc.xsl | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/xhtml/autotoc.xsl b/xhtml/autotoc.xsl index 8d609a2..8e55fd5 100644 --- a/xhtml/autotoc.xsl +++ b/xhtml/autotoc.xsl @@ -4,7 +4,7 @@ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0"> <!-- ******************************************************************** - $Id: autotoc.xsl 9295 2012-04-19 19:05:29Z bobstayton $ + $Id: autotoc.xsl 9692 2012-12-16 02:31:34Z dcramer $ ******************************************************************** This file is part of the XSL DocBook Stylesheet distribution. @@ -69,6 +69,11 @@ <div class="toc"> <xsl:copy-of select="$toc.title"/> <xsl:element name="{$toc.list.type}" namespace="http://www.w3.org/1999/xhtml"> + <xsl:call-template name="toc.list.attributes"> + <xsl:with-param name="toc-context" select="$toc-context"/> + <xsl:with-param name="toc.title.p" select="$toc.title.p"/> + <xsl:with-param name="nodes" select="$nodes"/> + </xsl:call-template> <xsl:call-template name="manual-toc"> <xsl:with-param name="tocentry" select="$tocentry/*[1]"/> </xsl:call-template> @@ -83,6 +88,11 @@ <div class="toc"> <xsl:copy-of select="$toc.title"/> <xsl:element name="{$toc.list.type}" namespace="http://www.w3.org/1999/xhtml"> + <xsl:call-template name="toc.list.attributes"> + <xsl:with-param name="toc-context" select="$toc-context"/> + <xsl:with-param name="toc.title.p" select="$toc.title.p"/> + <xsl:with-param name="nodes" select="$nodes"/> + </xsl:call-template> <xsl:apply-templates select="$nodes.plus" mode="toc"> <xsl:with-param name="toc-context" select="$toc-context"/> </xsl:apply-templates> @@ -95,6 +105,11 @@ <div class="toc"> <xsl:copy-of select="$toc.title"/> <xsl:element name="{$toc.list.type}" namespace="http://www.w3.org/1999/xhtml"> + <xsl:call-template name="toc.list.attributes"> + <xsl:with-param name="toc-context" select="$toc-context"/> + <xsl:with-param name="toc.title.p" select="$toc.title.p"/> + <xsl:with-param name="nodes" select="$nodes"/> + </xsl:call-template> <xsl:apply-templates select="$nodes" mode="toc"> <xsl:with-param name="toc-context" select="$toc-context"/> </xsl:apply-templates> @@ -108,6 +123,14 @@ </xsl:choose> </xsl:template> +<xsl:template name="toc.list.attributes"> + <xsl:param name="toc-context" select="."/> + <xsl:param name="toc.title.p" select="true()"/> + <xsl:param name="nodes" select="/NOT-AN-ELEMENT"/> + + <xsl:attribute name="class">toc</xsl:attribute> +</xsl:template> + <xsl:template name="make.lots"> <xsl:param name="toc.params" select="''"/> <xsl:param name="toc"/> @@ -540,6 +563,8 @@ <xsl:template name="manual-toc"> <xsl:param name="toc-context" select="."/> <xsl:param name="tocentry"/> + <xsl:param name="toc.title.p" select="true()"/> + <xsl:param name="nodes" select="/NOT-AN-ELEMENT"/> <!-- be careful, we don't want to change the current document to the other tree! --> @@ -567,6 +592,11 @@ <xsl:if test="$tocentry/*"> <xsl:element name="{$toc.list.type}" namespace="http://www.w3.org/1999/xhtml"> + <xsl:call-template name="toc.list.attributes"> + <xsl:with-param name="toc-context" select="$toc-context"/> + <xsl:with-param name="toc.title.p" select="$toc.title.p"/> + <xsl:with-param name="nodes" select="$nodes"/> + </xsl:call-template> <xsl:call-template name="manual-toc"> <xsl:with-param name="tocentry" select="$tocentry/*[1]"/> </xsl:call-template> |