]> granicus.if.org Git - docbook-dsssl/commitdiff
Patch #478068: procedures with one step
authorNorman Walsh <ndw@nwalsh.com>
Thu, 29 Nov 2001 22:42:20 +0000 (22:42 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Thu, 29 Nov 2001 22:42:20 +0000 (22:42 +0000)
xsl/fo/lists.xsl
xsl/html/lists.xsl

index e15131f09134ffa59c64526c2e761c35bfca921c..f99269f3776ab7782dcd7cfce2eafa23efa9230a 100644 (file)
                 select="*[not(self::step or self::title)]"/>
   <xsl:variable name="steps" select="step"/>
 
-  <fo:block id="{$id}"
-            space-before.optimum="1em"
-            space-before.minimum="0.8em"
-            space-before.maximum="1.2em">
+  <fo:block id="{$id}" xsl:use-attribute-sets="list.block.spacing">
     <xsl:if test="./title">
       <fo:block font-weight="bold">
         <xsl:apply-templates select="./title" mode="procedure.title.mode"/>
   <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
   <fo:list-item>
     <fo:list-item-label end-indent="label-end()">
-      <fo:block id="{$id}"
-                space-before.optimum="1em"
-                space-before.minimum="0.8em"
-                space-before.maximum="1.2em">
-        <xsl:apply-templates select="." mode="number">
-          <xsl:with-param name="recursive" select="0"/>
-        </xsl:apply-templates>
+      <fo:block id="{$id}" xsl:use-attribute-sets="list.item.spacing">
+        <!-- dwc: fix for one step procedures. Use a bullet if there's no step 2 -->
+        <xsl:choose>
+          <xsl:when test="count(../step) = 1">
+            <xsl:text>&#x2022;</xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:apply-templates select="." mode="number">
+              <xsl:with-param name="recursive" select="0"/>
+            </xsl:apply-templates>.
+          </xsl:otherwise>
+        </xsl:choose>
       </fo:block>
     </fo:list-item-label>
     <fo:list-item-body start-indent="body-start()">
index 75bc8b2f32c3e1fe3cb3169bd1b70b059a836d6d..942ea6ce7b79e7c4ee0ef8fee867921fb425f9de 100644 (file)
       <xsl:call-template name="formal.object.heading"/>
     </xsl:if>
     <xsl:apply-templates select="*[local-name()!='step']"/>
-    <ol>
-      <xsl:attribute name="type">
-        <xsl:value-of select="substring($procedure.step.numeration.formats,1,1)"/>
-      </xsl:attribute>
-      <xsl:apply-templates select="step"/>
-    </ol>
+
+    <xsl:choose>
+      <xsl:when test="count(step) = 1">
+        <ul>
+          <xsl:apply-templates select="step"/>
+        </ul>
+      </xsl:when>
+      <xsl:otherwise>
+        <ol>
+          <xsl:attribute name="type">
+            <xsl:value-of select="substring($procedure.step.numeration.formats,1,1)"/>
+          </xsl:attribute>
+          <xsl:apply-templates select="step"/>
+        </ol>
+      </xsl:otherwise>
+    </xsl:choose>
   </div>
 </xsl:template>