]> granicus.if.org Git - docbook-dsssl/commitdiff
Support toc.expand.depth a page-configurable parameter
authorNorman Walsh <ndw@nwalsh.com>
Wed, 20 Mar 2002 16:56:09 +0000 (16:56 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Wed, 20 Mar 2002 16:56:09 +0000 (16:56 +0000)
website/xsl/toc-tabular.xsl

index 777fa08f55e25358896518126f1330d7694f1ef7..4101c79206f20eb1d0d9f4ba0d7b19a489db0b94 100644 (file)
     </xsl:choose>
   </xsl:variable>
 
-  <xsl:variable name="isopen">
+  <xsl:variable name="use.toc.expand.depth">
+    <xsl:variable name="config-param" select="ancestor::autolayout/config[@param='toc.expand.depth']/@value"/>
+    <xsl:choose>
+      <!-- toc.expand.depth attribute is not in DTD -->
+      <xsl:when test="ancestor::toc/@toc.expand.depth">
+        <xsl:value-of select="ancestor::toc/@toc.expand.depth"/>
+      </xsl:when>
+      <xsl:when test="floor($config-param) > 0">
+        <xsl:value-of select="$config-param"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$toc.expand.depth"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="is.open">
     <xsl:choose>
       <xsl:when test="$pageid = @id
                       or $isancestor='1'
-                      or $depth &lt; $toc.expand.depth">1</xsl:when>
+                      or $depth &lt; $use.toc.expand.depth">1</xsl:when>
       <xsl:otherwise>0</xsl:otherwise>
     </xsl:choose>
   </xsl:variable>
           <xsl:when test="$hasdescendant = 0">
             <xsl:text>/other/leaf</xsl:text>
           </xsl:when>
-          <xsl:when test="$isancestor != 0 or $depth &lt; $toc.expand.depth">
+          <xsl:when test="$is.open != 0">
             <xsl:text>/other/open</xsl:text>
           </xsl:when>
           <xsl:otherwise>
     </xsl:choose>
   </span>
 
-  <xsl:if test="$pageid = @id or $isancestor='1' or $depth &lt; $toc.expand.depth">
+  <xsl:if test="$is.open != 0">
     <xsl:apply-templates select="tocentry">
       <xsl:with-param name="pageid" select="$pageid"/>
       <xsl:with-param name="relpath" select="$relpath"/>