<xsl:param name="toc.title.p" select="true()"/>
<xsl:param name="nodes" select="/NOT-AN-ELEMENT"/>
+ <xsl:variable name="nodes.plus" select="$nodes | qandaset"/>
+
<xsl:variable name="toc.title">
<xsl:if test="$toc.title.p">
<p>
</xsl:if>
</xsl:when>
<xsl:otherwise>
- <xsl:if test="$nodes">
- <div class="toc">
- <xsl:copy-of select="$toc.title"/>
- <xsl:element name="{$toc.list.type}">
- <xsl:apply-templates select="$nodes" mode="toc">
- <xsl:with-param name="toc-context" select="$toc-context"/>
- </xsl:apply-templates>
- </xsl:element>
- </div>
- </xsl:if>
+ <xsl:choose>
+ <xsl:when test="$qanda.in.toc != 0">
+ <xsl:if test="$nodes.plus">
+ <div class="toc">
+ <xsl:copy-of select="$toc.title"/>
+ <xsl:element name="{$toc.list.type}">
+ <xsl:apply-templates select="$nodes.plus" mode="toc">
+ <xsl:with-param name="toc-context" select="$toc-context"/>
+ </xsl:apply-templates>
+ </xsl:element>
+ </div>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="$nodes">
+ <div class="toc">
+ <xsl:copy-of select="$toc.title"/>
+ <xsl:element name="{$toc.list.type}">
+ <xsl:apply-templates select="$nodes" mode="toc">
+ <xsl:with-param name="toc-context" select="$toc-context"/>
+ </xsl:apply-templates>
+ </xsl:element>
+ </div>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:param name="toc-context" select="."/>
<xsl:param name="nodes" select="NOT-AN-ELEMENT"/>
+ <xsl:variable name="nodes.plus" select="$nodes | qandaset"/>
+
<xsl:variable name="subtoc">
<xsl:element name="{$toc.list.type}">
- <xsl:apply-templates mode="toc" select="$nodes">
- <xsl:with-param name="toc-context" select="$toc-context"/>
- </xsl:apply-templates>
+ <xsl:choose>
+ <xsl:when test="$qanda.in.toc != 0">
+ <xsl:apply-templates mode="toc" select="$nodes.plus">
+ <xsl:with-param name="toc-context" select="$toc-context"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates mode="toc" select="$nodes">
+ <xsl:with-param name="toc-context" select="$toc-context"/>
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:element>
</xsl:variable>
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
<xsl:if test="$toc.listitem.type = 'li'
- and $toc.section.depth > $depth and count($nodes)>0
+ and $toc.section.depth > $depth and
+ ( ($qanda.in.toc = 0 and count($nodes)>0) or
+ ($qanda.in.toc != 0 and count($nodes.plus)>0) )
and $toc.max.depth > $depth.from.context">
<xsl:copy-of select="$subtoc.list"/>
</xsl:if>
</xsl:element>
<xsl:if test="$toc.listitem.type != 'li'
- and $toc.section.depth > $depth and count($nodes)>0
+ and $toc.section.depth > $depth and
+ ( ($qanda.in.toc = 0 and count($nodes)>0) or
+ ($qanda.in.toc != 0 and count($nodes.plus)>0) )
and $toc.max.depth > $depth.from.context">
<xsl:copy-of select="$subtoc.list"/>
</xsl:if>
</xsl:element>
</xsl:template>
+<!-- Used only if qanda.in.toc parameter is non-zero -->
+<xsl:template match="qandaset" mode="toc">
+ <xsl:param name="toc-context" select="."/>
+ <xsl:call-template name="subtoc">
+ <xsl:with-param name="toc-context" select="$toc-context"/>
+ <xsl:with-param name="nodes" select="qandadiv | qandaentry"/>
+ </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="qandadiv|qandaentry" mode="toc">
+ <xsl:apply-templates select="." mode="qandatoc.mode"/>
+</xsl:template>
+
</xsl:stylesheet>
<!ENTITY profile.vendor SYSTEM "../params/profile.vendor.xml">
<!ENTITY punct.honorific SYSTEM "../params/punct.honorific.xml">
<!ENTITY qanda.defaultlabel SYSTEM "../params/qanda.defaultlabel.xml">
+<!ENTITY qanda.in.toc SYSTEM "../params/qanda.in.toc.xml">
<!ENTITY qanda.inherit.numeration SYSTEM "../params/qanda.inherit.numeration.xml">
<!ENTITY qanda.nested.in.toc SYSTEM "../params/qanda.nested.in.toc.xml">
<!ENTITY qandadiv.autolabel SYSTEM "../params/qandadiv.autolabel.xml">
<!ENTITY id.warnings SYSTEM "../params/id.warnings.xml">
<!ENTITY index.method SYSTEM "../params/index.method.xml">
<!ENTITY reference.autolabel SYSTEM "../params/reference.autolabel.xml">
+<!ENTITY glossary.sort SYSTEM "../params/glossary.sort.xml">
<reference id="qa"><title>QAndASet</title>
&qanda.defaultlabel;
&qanda.inherit.numeration;
+&qanda.in.toc;
&qanda.nested.in.toc;
</reference>
&glossterm.auto.link;
&firstterm.only.link;
&glossary.collection;
+&glossary.sort;
&glossentry.show.acronym;
</reference>
<src:fragref linkend="generate.section.toc.level.frag"/>
<src:fragref linkend="generate.toc.frag"/>
<src:fragref linkend="glossary.collection.frag"/>
+<src:fragref linkend="glossary.sort.frag"/>
<src:fragref linkend="glossentry.show.acronym.frag"/>
<src:fragref linkend="glossterm.auto.link.frag"/>
<src:fragref linkend="graphic.default.extension.frag"/>
<src:fragref linkend="punct.honorific.frag"/>
<src:fragref linkend="qanda.defaultlabel.frag"/>
<src:fragref linkend="qanda.inherit.numeration.frag"/>
+<src:fragref linkend="qanda.in.toc.frag"/>
<src:fragref linkend="qanda.nested.in.toc.frag"/>
<src:fragref linkend="qandadiv.autolabel.frag"/>
<src:fragref linkend="refentry.generate.name.frag"/>