]> granicus.if.org Git - docbook-dsssl/commitdiff
Fix bug in table.width where it wasn't using the tgroup
authorBob Stayton <bobs@sagehill.net>
Fri, 13 Jun 2008 00:29:04 +0000 (00:29 +0000)
committerBob Stayton <bobs@sagehill.net>
Fri, 13 Jun 2008 00:29:04 +0000 (00:29 +0000)
context for computing column widths.

xsl/fo/table.xsl

index c86d5b4f29d9562ac21ea873348c0e062eb3bec0..c983fe1523643b24eb87209f20f4db59aea77266 100644 (file)
   <xsl:variable name="column.sum">
     <xsl:choose>
       <!-- CALS table -->
-      <xsl:when test="@cols">
-        <xsl:if test="count(colspec) = @cols">
-          <xsl:for-each select="colspec">
-            <xsl:if test="position() != 1">
-              <xsl:text> + </xsl:text>
-            </xsl:if>
-            <xsl:choose>
-              <xsl:when test="not(@colwidth)">NOWIDTH</xsl:when>
-              <xsl:when test="contains(@colwidth, '*')">NOWIDTH</xsl:when>
-              <xsl:otherwise>
-                <xsl:value-of select="@colwidth"/>
-              </xsl:otherwise>
-            </xsl:choose>
-          </xsl:for-each>
-        </xsl:if>
+      <xsl:when test="tgroup/@cols">
+        <!-- change context to the first tgroup -->
+        <xsl:for-each select="tgroup[1]">
+          <xsl:if test="count(colspec) = @cols">
+            <xsl:for-each select="colspec">
+              <xsl:if test="position() != 1">
+                <xsl:text> + </xsl:text>
+              </xsl:if>
+              <xsl:choose>
+                <xsl:when test="not(@colwidth)">NOWIDTH</xsl:when>
+                <xsl:when test="contains(@colwidth, '*')">NOWIDTH</xsl:when>
+                <xsl:otherwise>
+                  <xsl:value-of select="@colwidth"/>
+                </xsl:otherwise>
+              </xsl:choose>
+            </xsl:for-each>
+          </xsl:if>
+        </xsl:for-each>
       </xsl:when>
       <xsl:otherwise>
         <!-- HTML table -->