]> granicus.if.org Git - docbook-dsssl/commitdiff
Modified template for "section" to handle section.level*.properties
authorBob Stayton <bobs@sagehill.net>
Wed, 10 Sep 2003 06:57:55 +0000 (06:57 +0000)
committerBob Stayton <bobs@sagehill.net>
Wed, 10 Sep 2003 06:57:55 +0000 (06:57 +0000)
attribute sets.

xsl/fo/sections.xsl

index 3e09feb2120d45294126e182fe0bc322b440e292..7d732e71f853f8a6dff4b6473d64dfe74f69b395 100644 (file)
     </xsl:call-template>
   </xsl:variable>
 
-  <fo:block id="{$id}" 
-            xsl:use-attribute-sets="section.level{$level}.properties">
-    <xsl:call-template name="section.titlepage"/>
+  <!-- xsl:use-attribute-sets takes only a Qname, not a variable -->
+  <xsl:choose>
+    <xsl:when test="$level = 1">
+      <fo:block id="{$id}"
+                xsl:use-attribute-sets="section.level1.properties">
+        <xsl:call-template name="section.content"/>
+      </fo:block>
+    </xsl:when>
+    <xsl:when test="$level = 2">
+      <fo:block id="{$id}"
+                xsl:use-attribute-sets="section.level2.properties">
+        <xsl:call-template name="section.content"/>
+      </fo:block>
+    </xsl:when>
+    <xsl:when test="$level = 3">
+      <fo:block id="{$id}"
+                xsl:use-attribute-sets="section.level3.properties">
+        <xsl:call-template name="section.content"/>
+      </fo:block>
+    </xsl:when>
+    <xsl:when test="$level = 4">
+      <fo:block id="{$id}"
+                xsl:use-attribute-sets="section.level4.properties">
+        <xsl:call-template name="section.content"/>
+      </fo:block>
+    </xsl:when>
+    <xsl:when test="$level = 5">
+      <fo:block id="{$id}"
+                xsl:use-attribute-sets="section.level5.properties">
+        <xsl:call-template name="section.content"/>
+      </fo:block>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:block id="{$id}"
+                xsl:use-attribute-sets="section.level6.properties">
+        <xsl:call-template name="section.content"/>
+      </fo:block>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
 
-    <xsl:variable name="toc.params">
-      <xsl:call-template name="find.path.params">
-        <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
-      </xsl:call-template>
-    </xsl:variable>
+<xsl:template name="section.content">
+  <xsl:call-template name="section.titlepage"/>
 
-    <xsl:if test="contains($toc.params, 'toc')
-                  and (count(ancestor::section)+1) &lt;= $generate.section.toc.level">
-      <xsl:call-template name="section.toc">
-        <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
-      </xsl:call-template>
-     <xsl:call-template name="section.toc.separator"/>
-    </xsl:if>
+  <xsl:variable name="toc.params">
+    <xsl:call-template name="find.path.params">
+      <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
+    </xsl:call-template>
+  </xsl:variable>
 
-    <xsl:apply-templates/>
-  </fo:block>
+  <xsl:if test="contains($toc.params, 'toc')
+                and (count(ancestor::section)+1) &lt;= $generate.section.toc.level">
+    <xsl:call-template name="section.toc">
+      <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
+    </xsl:call-template>
+   <xsl:call-template name="section.toc.separator"/>
+  </xsl:if>
+
+  <xsl:apply-templates/>
 </xsl:template>
 
 <xsl:template match="/section">