]> granicus.if.org Git - docbook-dsssl/commitdiff
Fix bug #1945872 to allow passthrough of colwidth values to
authorBob Stayton <bobs@sagehill.net>
Sun, 8 Mar 2009 08:29:41 +0000 (08:29 +0000)
committerBob Stayton <bobs@sagehill.net>
Sun, 8 Mar 2009 08:29:41 +0000 (08:29 +0000)
HTML table when no tablecolumns.extension is available and
when no instance of * appears in the table's colspecs.

xsl/html/table.xsl

index f20918996a58ef097343d2d7da58a7504ae3caaf..ffb428837c6f95306055c9872d0096e5a301f224 100644 (file)
               </xsl:call-template>
             </xsl:attribute>
           </xsl:when>
-         <xsl:when test="../@frame='none'">
-           <xsl:attribute name="style">
-             <xsl:text>border: none;</xsl:text>
-           </xsl:attribute>
-         </xsl:when>
+          <xsl:when test="../@frame='none'">
+            <xsl:attribute name="style">
+              <xsl:text>border: none;</xsl:text>
+            </xsl:attribute>
+          </xsl:when>
           <xsl:otherwise>
             <xsl:attribute name="style">
               <xsl:text>border-collapse: collapse;</xsl:text>
   <xsl:choose>
     <xsl:when test="contains($spans, '0')">
       <xsl:call-template name="normal-row">
-       <xsl:with-param name="spans" select="$spans"/>
+        <xsl:with-param name="spans" select="$spans"/>
       </xsl:call-template>
     </xsl:when>
     <xsl:otherwise>
       <!--
       <xsl:message>
-       <xsl:text>Ignoring row: </xsl:text>
-       <xsl:value-of select="$spans"/>
-       <xsl:text> = </xsl:text>
-       <xsl:call-template name="consume-row">
-         <xsl:with-param name="spans" select="$spans"/>
-       </xsl:call-template>
+        <xsl:text>Ignoring row: </xsl:text>
+        <xsl:value-of select="$spans"/>
+        <xsl:text> = </xsl:text>
+        <xsl:call-template name="consume-row">
+          <xsl:with-param name="spans" select="$spans"/>
+        </xsl:call-template>
       </xsl:message>
       -->
 
       <xsl:if test="normalize-space(.//text()) != ''">
-       <xsl:message>Warning: overlapped row contains content!</xsl:message>
+        <xsl:message>Warning: overlapped row contains content!</xsl:message>
       </xsl:if>
 
       <tr><xsl:comment> This row intentionally left blank </xsl:comment></tr>
 
       <xsl:apply-templates select="following-sibling::row[1]">
-       <xsl:with-param name="spans">
-         <xsl:call-template name="consume-row">
-           <xsl:with-param name="spans" select="$spans"/>
-         </xsl:call-template>
-       </xsl:with-param>
+        <xsl:with-param name="spans">
+          <xsl:call-template name="consume-row">
+            <xsl:with-param name="spans" select="$spans"/>
+          </xsl:call-template>
+        </xsl:with-param>
       </xsl:apply-templates>
     </xsl:otherwise>
   </xsl:choose>
   <xsl:param name="col">
     <xsl:choose>
       <xsl:when test="@revisionflag">
-       <xsl:number from="row"/>
+        <xsl:number from="row"/>
       </xsl:when>
       <xsl:otherwise>1</xsl:otherwise>
     </xsl:choose>
       <!-- If this is the last row, rowsep never applies. -->
       <xsl:when test="ancestor::entrytbl
                       and not (ancestor-or-self::row[1]/following-sibling::row)
-                     and not (ancestor::thead)">
+                      and not (ancestor::thead)">
         <xsl:value-of select="0"/>
       </xsl:when>
       <xsl:when test="not(ancestor-or-self::row[1]/following-sibling::row
       <xsl:choose>
         <xsl:when test="$colspec.colnum=$countcol">
           <col>
-            <xsl:if test="$colspec/@colwidth
-                          and $use.extensions != 0
-                          and $tablecolumns.extension != 0">
-              <xsl:attribute name="width">
-               <xsl:choose>
-                 <xsl:when test="normalize-space($colspec/@colwidth) = '*'">
-                    <xsl:value-of select="'1*'"/>
-                 </xsl:when>
-                 <xsl:otherwise>
-                    <xsl:value-of select="$colspec/@colwidth"/>
-                 </xsl:otherwise>
-               </xsl:choose>
-              </xsl:attribute>
-            </xsl:if>
+            <xsl:choose>
+              <xsl:when test="$colspec/@colwidth
+                            and $use.extensions != 0
+                            and $tablecolumns.extension != 0">
+                <xsl:attribute name="width">
+                  <xsl:choose>
+                    <xsl:when test="normalize-space($colspec/@colwidth) = '*'">
+                      <xsl:value-of select="'1*'"/>
+                    </xsl:when>
+                    <xsl:otherwise>
+                      <xsl:value-of select="$colspec/@colwidth"/>
+                    </xsl:otherwise>
+                  </xsl:choose>
+                </xsl:attribute>
+              </xsl:when>
+              <!-- pass through to HTML if no * in colspecs -->
+              <xsl:when test="$colspec/@colwidth and
+                             not($colspec/parent::*/colspec/@colwidth[contains(.,'*')])">
+                <xsl:attribute name="width">
+                  <xsl:choose>
+                    <xsl:when test="normalize-space($colspec/@colwidth) = '*'">
+                      <xsl:value-of select="'1*'"/>
+                    </xsl:when>
+                    <xsl:otherwise>
+                      <xsl:value-of select="$colspec/@colwidth"/>
+                    </xsl:otherwise>
+                  </xsl:choose>
+                </xsl:attribute>
+              </xsl:when>
+            </xsl:choose>
 
             <xsl:choose>
               <xsl:when test="$colspec/@align">