]> granicus.if.org Git - docbook-dsssl/commitdiff
Pass the toc-context down to the toc.line template.
authorBob Stayton <bobs@sagehill.net>
Fri, 12 Jan 2007 07:50:17 +0000 (07:50 +0000)
committerBob Stayton <bobs@sagehill.net>
Fri, 12 Jan 2007 07:50:17 +0000 (07:50 +0000)
xsl/fo/autotoc.xsl

index 3d30a9fa22615dc88622cc1b1dbfaf7dc35621a2..f58b6904ececf9530308b301080cf79a0aaf6c9e 100644 (file)
 <!-- ==================================================================== -->
 
 <xsl:template name="toc.line">
+  <xsl:param name="toc-context" select="NOTANODE"/>
+
   <xsl:variable name="id">
     <xsl:call-template name="object.id"/>
   </xsl:variable>
     </xsl:call-template>
   </xsl:variable>
 
-  <xsl:call-template name="toc.line"/>
+  <xsl:call-template name="toc.line">
+    <xsl:with-param name="toc-context" select="$toc-context"/>
+  </xsl:call-template>
 
   <xsl:variable name="nodes" select="qandadiv|qandaentry"/>
 
     </xsl:call-template>
   </xsl:variable>
 
-  <xsl:call-template name="toc.line"/>
+  <xsl:call-template name="toc.line">
+    <xsl:with-param name="toc-context" select="$toc-context"/>
+  </xsl:call-template>
 
   <xsl:variable name="nodes" select="glossary|bibliography|preface|chapter
                                      |reference|part|article|appendix|index"/>
     </xsl:call-template>
   </xsl:variable>
 
-  <xsl:call-template name="toc.line"/>
+  <xsl:call-template name="toc.line">
+    <xsl:with-param name="toc-context" select="$toc-context"/>
+  </xsl:call-template>
 
   <xsl:variable name="nodes" select="chapter|appendix|preface|reference|
                                      refentry|article|index|glossary|
 
   <xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
 
-  <xsl:call-template name="toc.line"/>
+  <xsl:call-template name="toc.line">
+    <xsl:with-param name="toc-context" select="$toc-context"/>
+  </xsl:call-template>
 
   <xsl:if test="$toc.section.depth > 0
                 and $toc.max.depth > $depth.from.context
 <xsl:template match="refentry" mode="toc">
   <xsl:param name="toc-context" select="."/>
 
-  <xsl:call-template name="toc.line"/>
+  <xsl:call-template name="toc.line">
+    <xsl:with-param name="toc-context" select="$toc-context"/>
+  </xsl:call-template>
 </xsl:template>
 
 <xsl:template match="preface|chapter|appendix|article"
     </xsl:call-template>
   </xsl:variable>
 
-  <xsl:call-template name="toc.line"/>
+  <xsl:call-template name="toc.line">
+    <xsl:with-param name="toc-context" select="$toc-context"/>
+  </xsl:call-template>
 
   <xsl:variable name="nodes" select="section|sect1
                                      |simplesect[$simplesect.in.toc != 0]
     </xsl:call-template>
   </xsl:variable>
 
-  <xsl:call-template name="toc.line"/>
+  <xsl:call-template name="toc.line">
+    <xsl:with-param name="toc-context" select="$toc-context"/>
+  </xsl:call-template>
 
   <xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
 
     </xsl:call-template>
   </xsl:variable>
 
-  <xsl:call-template name="toc.line"/>
+  <xsl:call-template name="toc.line">
+    <xsl:with-param name="toc-context" select="$toc-context"/>
+  </xsl:call-template>
 
   <xsl:variable name="reldepth"
                 select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
     </xsl:call-template>
   </xsl:variable>
 
-  <xsl:call-template name="toc.line"/>
+  <xsl:call-template name="toc.line">
+    <xsl:with-param name="toc-context" select="$toc-context"/>
+  </xsl:call-template>
 
   <xsl:variable name="reldepth"
                 select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
     </xsl:call-template>
   </xsl:variable>
 
-  <xsl:call-template name="toc.line"/>
+  <xsl:call-template name="toc.line">
+    <xsl:with-param name="toc-context" select="$toc-context"/>
+  </xsl:call-template>
 
   <xsl:variable name="reldepth"
                 select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
 <xsl:template match="sect5|simplesect" mode="toc">
   <xsl:param name="toc-context" select="."/>
 
-  <xsl:call-template name="toc.line"/>
+  <xsl:call-template name="toc.line">
+    <xsl:with-param name="toc-context" select="$toc-context"/>
+  </xsl:call-template>
 </xsl:template>
 
 <xsl:template name="set.toc.indent">
   <xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
 
   <xsl:if test="$toc.section.depth &gt;= $depth">
-    <xsl:call-template name="toc.line"/>
+    <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
               mode="toc">
   <xsl:param name="toc-context" select="."/>
 
-  <xsl:call-template name="toc.line"/>
+  <xsl:call-template name="toc.line">
+    <xsl:with-param name="toc-context" select="$toc-context"/>
+  </xsl:call-template>
 </xsl:template>
 
 <xsl:template match="index" mode="toc">
   <xsl:param name="toc-context" select="."/>
 
   <xsl:if test="* or $generate.index != 0">
-    <xsl:call-template name="toc.line"/>
+    <xsl:call-template name="toc.line">
+    <xsl:with-param name="toc-context" select="$toc-context"/>
+  </xsl:call-template>
   </xsl:if>
 </xsl:template>
 
 </xsl:template>
 
 <xsl:template match="figure|table|example|equation|procedure" mode="toc">
-  <xsl:call-template name="toc.line"/>
+  <xsl:param name="toc-context" select="."/>
+  <xsl:call-template name="toc.line">
+    <xsl:with-param name="toc-context" select="$toc-context"/>
+  </xsl:call-template>
 </xsl:template>
 
 <!-- ==================================================================== -->