</xsl:call-template>
</xsl:variable>
- <xsl:variable name="nodes" select="book|setindex"/>
+ <xsl:variable name="nodes" select=".|book|set|setindex"/>
<xsl:if test="$nodes">
<fo:block id="toc...{$id}"
</xsl:if>
</xsl:template>
+<xsl:template match="set" mode="toc">
+ <xsl:param name="toc-context" select="."/>
+
+ <xsl:variable name="id">
+ <xsl:call-template name="object.id"/>
+ </xsl:variable>
+
+ <xsl:variable name="cid">
+ <xsl:call-template name="object.id">
+ <xsl:with-param name="object" select="$toc-context"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:call-template name="toc.line">
+ <xsl:with-param name="toc-context" select="$toc-context"/>
+ </xsl:call-template>
+
+ <xsl:variable name="nodes" select="set|book|setindex"/>
+
+ <xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
+
+ <xsl:if test="$toc.section.depth > 0
+ and $toc.max.depth > $depth.from.context
+ and $nodes">
+ <fo:block id="toc.{$cid}.{$id}">
+ <xsl:attribute name="margin-left">
+ <xsl:call-template name="set.toc.indent"/>
+ </xsl:attribute>
+
+ <xsl:apply-templates select="$nodes" mode="toc">
+ <xsl:with-param name="toc-context" select="$toc-context"/>
+ </xsl:apply-templates>
+ </fo:block>
+ </xsl:if>
+</xsl:template>
+
<xsl:template match="part" mode="toc">
<xsl:param name="toc-context" select="."/>
</xsl:variable>
<xsl:variable name="preamble"
- select="*[not(self::book or self::setindex)]"/>
+ select="*[not(self::book or self::set or self::setindex)]"/>
- <xsl:variable name="content" select="book|setindex"/>
+ <xsl:variable name="content" select="book|set|setindex"/>
<xsl:variable name="titlepage-master-reference">
<xsl:call-template name="select.pagemaster">