]> granicus.if.org Git - docbook-dsssl/commitdiff
Make list/procedure titles use gentext and have consisten formatting
authorNorman Walsh <ndw@nwalsh.com>
Sat, 29 Jun 2002 11:00:42 +0000 (11:00 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Sat, 29 Jun 2002 11:00:42 +0000 (11:00 +0000)
xsl/fo/formal.xsl
xsl/fo/lists.xsl
xsl/html/formal.xsl
xsl/html/lists.xsl

index 1f368278b995552e58d8893e4125556e967edc5f..68651cad4a4f7c00504abc66b1d8811e837b4431 100644 (file)
@@ -33,9 +33,9 @@
 </xsl:template>
 
 <xsl:template name="formal.object.heading">
-  <xsl:param name="title"></xsl:param>
+  <xsl:param name="object" select="."/>
   <fo:block xsl:use-attribute-sets="formal.title.properties">
-    <xsl:apply-templates select="." mode="object.title.markup"/>
+    <xsl:apply-templates select="$object" mode="object.title.markup"/>
   </fo:block>
 </xsl:template>
 
index 5fcd2da0d46697969757a3fa596e39e48661d15b..652210081ee684217a34ed54dd439800c6f859bf 100644 (file)
 <!-- ==================================================================== -->
 
 <xsl:template match="title" mode="list.title.mode">
-  <fo:block font-size="12pt" font-weight="bold"
-            xsl:use-attribute-sets="list.block.spacing">
-    <xsl:apply-templates/>
-  </fo:block>
+  <xsl:call-template name="formal.object.heading">
+    <xsl:with-param name="object" select=".."/>
+  </xsl:call-template>
 </xsl:template>
 
 <!-- ==================================================================== -->
 
   <fo:block id="{$id}" xsl:use-attribute-sets="list.block.spacing">
     <xsl:if test="./title and $placement = 'before'">
-      <xsl:choose>
-        <xsl:when test="$formal.procedures != 0">
-          <xsl:call-template name="formal.object.heading"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <fo:block font-weight="bold">
-            <xsl:apply-templates select="./title" mode="procedure.title.mode"/>
-          </fo:block>
-        </xsl:otherwise>
-      </xsl:choose>
+      <!-- n.b. gentext code tests for $formal.procedures and may make an "informal" -->
+      <!-- heading even though we called formal.object.heading. odd but true. -->
+      <xsl:call-template name="formal.object.heading"/>
     </xsl:if>
 
     <xsl:apply-templates select="$preamble"/>
     </fo:list-block>
 
     <xsl:if test="./title and $placement != 'before'">
-      <xsl:choose>
-        <xsl:when test="$formal.procedures != 0">
-          <xsl:call-template name="formal.object.heading"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <fo:block font-weight="bold">
-            <xsl:apply-templates select="./title" mode="procedure.title.mode"/>
-          </fo:block>
-        </xsl:otherwise>
-      </xsl:choose>
+      <!-- n.b. gentext code tests for $formal.procedures and may make an "informal" -->
+      <!-- heading even though we called formal.object.heading. odd but true. -->
+      <xsl:call-template name="formal.object.heading"/>
     </xsl:if>
   </fo:block>
 </xsl:template>
 <xsl:template match="procedure/title">
 </xsl:template>
 
-<xsl:template match="procedure/title" mode="procedure.title.mode">
-  <xsl:apply-templates/>
-</xsl:template>
-
 <xsl:template match="substeps">
   <fo:list-block xsl:use-attribute-sets="list.block.spacing"
                  provisional-distance-between-starts="2em"
   <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
 
   <fo:block id="{$id}">
-    <xsl:if test="./title">
-      <fo:block xsl:use-attribute-sets="formal.title.properties">
-        <xsl:apply-templates select="./title" mode="calloutlist.title.mode"/>
-      </fo:block>
+    <xsl:if test="title">
+      <xsl:apply-templates select="title" mode="list.title.mode"/>
     </xsl:if>
 
     <fo:list-block space-before.optimum="1em"
 <xsl:template match="calloutlist/title">
 </xsl:template>
 
-<xsl:template match="calloutlist/title" mode="calloutlist.title.mode">
-  <xsl:apply-templates/>
-</xsl:template>
-
 <xsl:template match="callout">
   <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
   <fo:list-item id="{$id}">
index c6f910f0566ac8565835d472fe797e19bf44b998..4267412ee95cbae83a07d6d19086953005569b8f 100644 (file)
 </xsl:template>
 
 <xsl:template name="formal.object.heading">
+  <xsl:param name="object" select="."/>
   <p class="title">
     <b>
-      <xsl:apply-templates select="." mode="object.title.markup">
+      <xsl:apply-templates select="$object" mode="object.title.markup">
         <xsl:with-param name="allow-anchors" select="1"/>
       </xsl:apply-templates>
     </b>
index 9c5d9bf22478a319922f2731404d13e7cf4c268f..0a9d62b3585a7f15de63909fecb8fad329eb5f10 100644 (file)
@@ -22,7 +22,7 @@
   <div class="{name(.)}">
     <xsl:call-template name="anchor"/>
     <xsl:if test="title">
-      <xsl:apply-templates select="title"/>
+      <xsl:call-template name="formal.object.heading"/>
     </xsl:if>
     <ul type="{$itemsymbol}">
       <xsl:if test="@spacing='compact'">
@@ -36,7 +36,7 @@
 </xsl:template>
 
 <xsl:template match="itemizedlist/title">
-  <p class="title"><b><xsl:apply-templates/></b></p>
+  <!-- nop -->
 </xsl:template>
 
 <xsl:template match="itemizedlist/listitem">
   <div class="{name(.)}">
     <xsl:call-template name="anchor"/>
     <xsl:if test="title">
-      <xsl:apply-templates select="title"/>
+      <xsl:call-template name="formal.object.heading"/>
     </xsl:if>
     <ol>
     <xsl:if test="$start != '1'">
 </xsl:template>
 
 <xsl:template match="orderedlist/title">
-  <p class="title"><b><xsl:apply-templates/></b></p>
+  <!-- nop -->
 </xsl:template>
 
 <xsl:template match="orderedlist/listitem">
   <div class="{name(.)}">
     <xsl:call-template name="anchor"/>
     <xsl:if test="title">
-      <xsl:apply-templates select="title"/>
+      <xsl:call-template name="formal.object.heading"/>
     </xsl:if>
 
     <xsl:choose>
 </xsl:template>
 
 <xsl:template match="variablelist/title">
-  <p class="title"><b><xsl:apply-templates/></b></p>
+  <!-- nop -->
 </xsl:template>
 
 <xsl:template match="listitem" mode="xref">
     <xsl:call-template name="anchor"/>
 
     <xsl:if test="title and $placement = 'before'">
-      <xsl:choose>
-        <xsl:when test="$formal.procedures != 0">
-          <xsl:call-template name="formal.object.heading"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:apply-templates select="title"/>
-        </xsl:otherwise>
-      </xsl:choose>
+      <xsl:call-template name="formal.object.heading"/>
     </xsl:if>
 
     <xsl:apply-templates select="$preamble"/>
     </xsl:choose>
 
     <xsl:if test="title and $placement != 'before'">
-      <xsl:choose>
-        <xsl:when test="$formal.procedures != 0">
-          <xsl:call-template name="formal.object.heading"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:apply-templates select="title"/>
-        </xsl:otherwise>
-      </xsl:choose>
+      <xsl:call-template name="formal.object.heading"/>
     </xsl:if>
   </div>
 </xsl:template>
 
 <xsl:template match="procedure/title">
-  <p class="title">
-    <b>
-      <xsl:apply-templates/>
-    </b>
-  </p>
-</xsl:template>
-
-<xsl:template match="title" mode="procedure.title.mode">
-  <p class="title">
-    <b>
-      <xsl:apply-templates/>
-    </b>
-  </p>
+  <!-- nop -->
 </xsl:template>
 
 <xsl:template match="substeps">
 </xsl:template>
 
 <xsl:template match="step/title">
-  <xsl:apply-templates select="." mode="procedure.title.mode"/>
+  <p class="title">
+    <b>
+      <xsl:apply-templates/>
+    </b>
+  </p>
 </xsl:template>
 
 <!-- ==================================================================== -->
 <xsl:template match="calloutlist">
   <div class="{name(.)}">
     <xsl:call-template name="anchor"/>
-    <xsl:if test="./title">
-      <p>
-        <b>
-          <xsl:apply-templates select="./title" mode="calloutlist.title.mode"/>
-        </b>
-      </p>
+    <xsl:if test="title">
+      <xsl:call-template name="formal.object.heading"/>
     </xsl:if>
     <xsl:choose>
       <xsl:when test="$callout.list.table != 0">
 <xsl:template match="calloutlist/title">
 </xsl:template>
 
-<xsl:template match="calloutlist/title" mode="calloutlist.title.mode">
-  <xsl:apply-templates/>
-</xsl:template>
-
 <xsl:template match="callout">
   <xsl:choose>
     <xsl:when test="$callout.list.table != 0">