]> granicus.if.org Git - docbook-dsssl/commitdiff
Bug #653344: Output fo:table-columns in simplelist tables
authorNorman Walsh <ndw@nwalsh.com>
Tue, 21 Jan 2003 00:06:48 +0000 (00:06 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Tue, 21 Jan 2003 00:06:48 +0000 (00:06 +0000)
xsl/fo/lists.xsl

index 741c893ef65b6b52ff4212f91dfcab1480168553..eba1da514908b7ba369ae371a82ec095fe624f31 100644 (file)
 <xsl:template match="simplelist">
   <!-- with no type specified, the default is 'vert' -->
   <fo:table xsl:use-attribute-sets="normal.para.spacing">
+    <xsl:call-template name="simplelist.table.columns">
+      <xsl:with-param name="cols">
+        <xsl:choose>
+          <xsl:when test="@columns">
+            <xsl:value-of select="@columns"/>
+          </xsl:when>
+          <xsl:otherwise>1</xsl:otherwise>
+        </xsl:choose>
+      </xsl:with-param>
+    </xsl:call-template>
     <fo:table-body>
       <xsl:call-template name="simplelist.vert">
        <xsl:with-param name="cols">
 
 <xsl:template match="simplelist[@type='horiz']">
   <fo:table xsl:use-attribute-sets="normal.para.spacing">
+    <xsl:call-template name="simplelist.table.columns">
+      <xsl:with-param name="cols">
+        <xsl:choose>
+          <xsl:when test="@columns">
+            <xsl:value-of select="@columns"/>
+          </xsl:when>
+          <xsl:otherwise>1</xsl:otherwise>
+        </xsl:choose>
+      </xsl:with-param>
+    </xsl:call-template>
     <fo:table-body>
       <xsl:call-template name="simplelist.horiz">
        <xsl:with-param name="cols">
 
 <xsl:template match="simplelist[@type='vert']">
   <fo:table xsl:use-attribute-sets="normal.para.spacing">
+    <xsl:call-template name="simplelist.table.columns">
+      <xsl:with-param name="cols">
+        <xsl:choose>
+          <xsl:when test="@columns">
+            <xsl:value-of select="@columns"/>
+          </xsl:when>
+          <xsl:otherwise>1</xsl:otherwise>
+        </xsl:choose>
+      </xsl:with-param>
+    </xsl:call-template>
     <fo:table-body>
       <xsl:call-template name="simplelist.vert">
        <xsl:with-param name="cols">
   </fo:table>
 </xsl:template>
 
+<xsl:template name="simplelist.table.columns">
+  <xsl:param name="cols" select="1"/>
+  <xsl:param name="curcol" select="1"/>
+  <fo:table-column column-number="{$curcol}"/>
+  <xsl:if test="$curcol &lt; $cols">
+    <xsl:call-template name="simplelist.table.columns">
+      <xsl:with-param name="cols" select="$cols"/>
+      <xsl:with-param name="curcol" select="$curcol + 1"/>
+    </xsl:call-template>
+  </xsl:if>
+</xsl:template>
+
 <xsl:template name="simplelist.horiz">
   <xsl:param name="cols">1</xsl:param>
   <xsl:param name="cell">1</xsl:param>
 <xsl:template match="segmentedlist" mode="seglist-table">
   <xsl:apply-templates select="title" mode="list.title.mode" />
   <fo:table>
+    <fo:table-column column-number="1"/>
+    <fo:table-column column-number="2"/>
     <fo:table-header>
       <fo:table-row>
         <xsl:apply-templates select="segtitle" mode="seglist-table"/>