]> granicus.if.org Git - docbook-dsssl/commitdiff
Changed section.level template to return a number that matches
authorBob Stayton <bobs@sagehill.net>
Tue, 1 Oct 2002 05:06:27 +0000 (05:06 +0000)
committerBob Stayton <bobs@sagehill.net>
Tue, 1 Oct 2002 05:06:27 +0000 (05:06 +0000)
the section level (sect1 = 1, etc.), and changed other
templates to compensate for the change, so the output
should be the same as before.

xsl/html/sections.xsl

index d4f384e47880ac23294021741cbc2a75cb15d3a0..20782735d6295a993c1f79123232e6e3e9be6e71 100644 (file)
     </xsl:choose>
   </xsl:variable>
 
-  <xsl:element name="h{$level}">
+  <!-- HTML H level is one higher than section level -->
+  <xsl:variable name="hlevel" select="$level + 1"/>
+  <xsl:element name="h{$hlevel}">
     <xsl:attribute name="class">title</xsl:attribute>
     <xsl:if test="$css.decoration != '0'">
-      <xsl:if test="$level&lt;3">
+      <xsl:if test="$hlevel&lt;3">
         <xsl:attribute name="style">clear: both</xsl:attribute>
       </xsl:if>
     </xsl:if>
                       or local-name($container) = 'index'
                       or local-name($container) = 'partintro'
                       or local-name($container) = 'preface'
-                      or local-name($container) = 'setindex'">2</xsl:when>
+                      or local-name($container) = 'setindex'">1</xsl:when>
       <xsl:when test="local-name($container) = 'glossdiv'">
-        <xsl:value-of select="count(ancestor::glossdiv)+2"/>
+        <xsl:value-of select="count(ancestor::glossdiv)+1"/>
       </xsl:when>
       <xsl:when test="local-name($container) = 'sect1'
                       or local-name($container) = 'sect2'
         </xsl:variable>
         <xsl:value-of select="$slevel + 1"/>
       </xsl:when>
-      <xsl:otherwise>2</xsl:otherwise>
+      <xsl:otherwise>1</xsl:otherwise>
     </xsl:choose>
   </xsl:variable>
 
-  <xsl:variable name="level">
+  <!-- HTML H level is one higher than section level -->
+  <xsl:variable name="hlevel">
     <xsl:choose>
       <xsl:when test="@renderas = 'sect1'">2</xsl:when>
       <xsl:when test="@renderas = 'sect2'">3</xsl:when>
       <xsl:when test="@renderas = 'sect4'">5</xsl:when>
       <xsl:when test="@renderas = 'sect5'">6</xsl:when>
       <xsl:otherwise>
-        <xsl:value-of select="$clevel"/>
+        <xsl:value-of select="$clevel + 1"/>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:variable>
 
-  <xsl:element name="h{$level}">
+  <xsl:element name="h{$hlevel}">
     <xsl:call-template name="anchor">
       <xsl:with-param name="conditional" select="0"/>
     </xsl:call-template>