<xsl:variable name="nodes" select="section|sect1|refentry
|article|bibliography|glossary
+ |qandaset[$qanda.in.toc != 0]
|appendix|index"/>
<xsl:if test="$nodes">
<fo:block id="toc...{$id}"
<xsl:variable name="nodes"
select="section|sect1|sect2|sect3|sect4|sect5|refentry
+ |qandaset[$qanda.in.toc != 0]
|bridgehead[$bridgehead.in.toc != 0]"/>
<xsl:variable name="level">
</xsl:call-template>
<xsl:variable name="nodes" select="section|sect1
+ |qandaset[$qanda.in.toc != 0]
|simplesect[$simplesect.in.toc != 0]
|refentry|appendix"/>
<xsl:call-template name="set.toc.indent"/>
</xsl:attribute>
- <xsl:apply-templates select="sect2" mode="toc">
+ <xsl:apply-templates select="sect2|qandaset[$qanda.in.toc != 0]"
+ mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</fo:block>
</xsl:call-template>
</xsl:attribute>
- <xsl:apply-templates select="sect3" mode="toc">
+ <xsl:apply-templates select="sect3|qandaset[$qanda.in.toc != 0]"
+ mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</fo:block>
</xsl:call-template>
</xsl:attribute>
- <xsl:apply-templates select="sect4" mode="toc">
+ <xsl:apply-templates select="sect4|qandaset[$qanda.in.toc != 0]"
+ mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</fo:block>
</xsl:call-template>
</xsl:attribute>
- <xsl:apply-templates select="sect5" mode="toc">
+ <xsl:apply-templates select="sect5|qandaset[$qanda.in.toc != 0]"
+ mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</fo:block>
</xsl:call-template>
</xsl:attribute>
- <xsl:apply-templates select="section" mode="toc">
+ <xsl:apply-templates select="section|qandaset[$qanda.in.toc != 0]"
+ mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</fo:block>
<!-- ==================================================================== -->
+<!-- qandaset handled like a section when qanda.in.toc is set -->
+<xsl:template match="qandaset" 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:variable name="depth" select="count(ancestor::section) + 1"/>
+ <xsl:variable name="reldepth"
+ select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
+
+ <xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
+
+ <xsl:if test="$toc.section.depth >= $depth">
+ <xsl:call-template name="toc.line">
+ <xsl:with-param name="toc-context" select="$toc-context"/>
+ </xsl:call-template>
+
+ <xsl:if test="$toc.section.depth > $depth
+ and $toc.max.depth > $depth.from.context
+ and (child::qandadiv or child::qandaentry)">
+ <fo:block id="toc.{$cid}.{$id}">
+ <xsl:attribute name="margin-left">
+ <xsl:call-template name="set.toc.indent">
+ <xsl:with-param name="reldepth" select="$reldepth"/>
+ </xsl:call-template>
+ </xsl:attribute>
+
+ <xsl:apply-templates select="qandadiv|qandaentry" mode="toc">
+ <xsl:with-param name="toc-context" select="$toc-context"/>
+ </xsl:apply-templates>
+ </fo:block>
+ </xsl:if>
+ </xsl:if>
+</xsl:template>
+
</xsl:stylesheet>
&qandadiv.autolabel;
&qanda.inherit.numeration;
&qanda.defaultlabel;
+&qanda.in.toc;
+&qanda.nested.in.toc;
</reference>
<reference id="biblio"><title>Bibliography</title>
<src:fragref linkend="profile.vendor.frag"/>
<src:fragref linkend="punct.honorific.frag"/>
<src:fragref linkend="qanda.defaultlabel.frag"/>
+<src:fragref linkend="qanda.in.toc.frag"/>
+<src:fragref linkend="qanda.nested.in.toc.frag"/>
<src:fragref linkend="qanda.inherit.numeration.frag"/>
<src:fragref linkend="qandadiv.autolabel.frag"/>
<src:fragref linkend="qanda.title.level1.properties.frag"/>