]> granicus.if.org Git - docbook-dsssl/commitdiff
Fixed bug 958433: simplelist table error in FOP.
authorBob Stayton <bobs@sagehill.net>
Wed, 11 Aug 2004 22:57:49 +0000 (22:57 +0000)
committerBob Stayton <bobs@sagehill.net>
Wed, 11 Aug 2004 22:57:49 +0000 (22:57 +0000)
Also added support for a PI to set the table width.

xsl/fo/lists.xsl

index 7cc3e70ee2294ff463ad618aa07f00b214cb8ee1..0f1d9952ac7d77f6518b9ecb3e39016679f828c8 100644 (file)
 </xsl:template>
 
 <xsl:template match="simplelist[@type='horiz']">
+
+  <xsl:variable name="explicit.table.width">
+    <xsl:call-template name="dbfo-attribute">
+      <xsl:with-param name="pis"
+                      select="processing-instruction('dbfo')"/>
+      <xsl:with-param name="attribute" select="'list-width'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="table.width">
+    <xsl:choose>
+      <xsl:when test="$explicit.table.width != ''">
+        <xsl:value-of select="$explicit.table.width"/>
+      </xsl:when>
+      <xsl:when test="$default.table.width = ''">
+        <xsl:text>100%</xsl:text>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$default.table.width"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
   <fo:table xsl:use-attribute-sets="normal.para.spacing">
+    <xsl:choose>
+      <xsl:when test="$axf.extensions != 0">
+        <xsl:attribute name="table-layout">auto</xsl:attribute>
+       <xsl:if test="$explicit.table.width != ''">
+          <xsl:attribute name="width"><xsl:value-of 
+                            select="$explicit.table.width"/></xsl:attribute>
+        </xsl:if>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:attribute name="table-layout">fixed</xsl:attribute>
+        <xsl:attribute name="width"><xsl:value-of 
+                                     select="$table.width"/></xsl:attribute>
+      </xsl:otherwise>
+    </xsl:choose>
     <xsl:call-template name="simplelist.table.columns">
       <xsl:with-param name="cols">
         <xsl:choose>