]> granicus.if.org Git - docbook-dsssl/commitdiff
Improve procedure step/substep enumeration
authorNorman Walsh <ndw@nwalsh.com>
Thu, 26 Apr 2001 15:20:49 +0000 (15:20 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Thu, 26 Apr 2001 15:20:49 +0000 (15:20 +0000)
xsl/fo/lists.xsl
xsl/html/lists.xsl

index 4889c72c664f6e2cc9d70c4040d7914fc0c62f81..bdfd9b0dcdd6026c42134d7db53a99ce927c1b16 100644 (file)
 </xsl:template>
 
 <xsl:template match="step">
+  <xsl:variable name="depth" select="count(ancestor::substeps)"/>
+  <xsl:variable name="type" select="$depth mod 5"/>
+
   <fo:list-item>
     <fo:list-item-label end-indent="label-end()">
       <fo:block>
-        <xsl:number count="step" format="1."/>
+        <xsl:choose>
+          <xsl:when test="$depth = 0">
+            <xsl:number count="step" format="1."/>
+          </xsl:when>
+          <xsl:when test="$type = 1">
+            <xsl:number count="step" format="a."/>
+          </xsl:when>
+          <xsl:when test="$type = 2">
+            <xsl:number count="step" format="i."/>
+          </xsl:when>
+          <xsl:when test="$type = 3">
+            <xsl:number count="step" format="A."/>
+          </xsl:when>
+          <xsl:when test="$type = 4">
+            <xsl:number count="step" format="I."/>
+          </xsl:when>
+          <xsl:when test="$type = 0">
+            <xsl:number count="step" format="1."/>
+          </xsl:when>
+        </xsl:choose>
       </fo:block>
     </fo:list-item-label>
     <fo:list-item-body start-indent="body-start()">
index bca4f31bc53d8d2d393ceacc8809c7e89f136de1..095ad5940362f4a32fe64481885156bf2ba51d55 100644 (file)
 </xsl:template>
 
 <xsl:template match="substeps">
-  <ol><xsl:apply-templates/></ol>
+  <xsl:variable name="depth" select="count(ancestor::substeps)"/>
+  <xsl:variable name="type" select="$depth mod 5"/>
+  <xsl:variable name="numeration">
+    <xsl:choose>
+      <xsl:when test="$type = 0">a</xsl:when>
+      <xsl:when test="$type = 1">i</xsl:when>
+      <xsl:when test="$type = 2">A</xsl:when>
+      <xsl:when test="$type = 3">I</xsl:when>
+      <xsl:when test="$type = 4">1</xsl:when>
+    </xsl:choose>
+  </xsl:variable>
+
+  <ol type="{$numeration}">
+    <xsl:apply-templates/>
+  </ol>
 </xsl:template>
 
 <xsl:template match="step">