]> granicus.if.org Git - docbook-dsssl/commitdiff
Handle nested refsections
authorNorman Walsh <ndw@nwalsh.com>
Thu, 14 Nov 2002 16:31:52 +0000 (16:31 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Thu, 14 Nov 2002 16:31:52 +0000 (16:31 +0000)
xsl/html/refentry.xsl

index 242ac509cf52fef3f7170f493fe75f4ff934cbdc..ff52c80c418b8068ab29a2ccbe967e4174119850 100644 (file)
   </div>
 </xsl:template>
 
-<xsl:template match="refsection/title|refsect1/title">
+<xsl:template match="refsection/title">
+  <!-- the ID is output in the block.object call for refsect1 -->
+  <xsl:variable name="level" select="count(ancestor-or-self::refsection)"/>
+  <xsl:variable name="hlevel">
+    <xsl:choose>
+      <xsl:when test="$level &gt; 5">6</xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$level+1"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+  <xsl:element name="h{$hlevel}">
+    <xsl:apply-templates/>
+  </xsl:element>
+</xsl:template>
+
+<xsl:template match="refsect1/title">
   <!-- the ID is output in the block.object call for refsect1 -->
   <h2>
     <xsl:apply-templates/>