]> granicus.if.org Git - docbook-dsssl/commitdiff
A few bug fixes for the colsep/rowsep code
authorNorman Walsh <ndw@nwalsh.com>
Sun, 13 Apr 2003 17:59:31 +0000 (17:59 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Sun, 13 Apr 2003 17:59:31 +0000 (17:59 +0000)
xsl/common/table.xsl
xsl/fo/table.xsl
xsl/html/table.xsl

index 4d4b58d90b4bbf48e093656f1de70664dd64f12b..416d346f76a0b68884e999233f19cb91da51a2d1 100644 (file)
   </xsl:if>
 </xsl:template>
 
-<!-- Modified versions of finaltd and sfinaltd, return a non-empty string -->
-<!-- if there are more table cells in this row -->
-
-<xsl:template name="has-more-td">
-  <xsl:param name="spans"/>
-  <xsl:param name="col" select="0"/>
-
-  <xsl:if test="$spans != ''">
-    <xsl:choose>
-      <xsl:when test="starts-with($spans,'0:')">
-        <xsl:text>X</xsl:text>
-      </xsl:when>
-      <xsl:otherwise></xsl:otherwise>
-    </xsl:choose>
-
-    <xsl:call-template name="has-more-td">
-      <xsl:with-param name="spans" select="substring-after($spans,':')"/>
-      <xsl:with-param name="col" select="$col+1"/>
-    </xsl:call-template>
-  </xsl:if>
-</xsl:template>
-
 <xsl:template name="entry.colnum">
   <xsl:param name="entry" select="."/>
 
index d60b109b13cd70f20b826c2394d5a945c114c69d..c78cc66383063b47bb1cce7117778d5a627c425c 100644 (file)
@@ -65,7 +65,7 @@ to be incomplete. Don't forget to read the source, too :-)</para>
   <xsl:variable name="rowsep">
     <xsl:choose>
       <!-- If this is the last row, rowsep never applies. -->
-      <xsl:when test="not(ancestor-or-self::row/following-sibling::row
+      <xsl:when test="not(ancestor-or-self::row[1]/following-sibling::row
                           or ancestor-or-self::thead/following-sibling::tbody
                           or ancestor-or-self::tbody/preceding-sibling::tfoot)">
         <xsl:value-of select="0"/>
@@ -328,22 +328,10 @@ to be incomplete. Don't forget to read the source, too :-)</para>
     </xsl:call-template>
   </xsl:variable>
 
-  <xsl:variable name="more.cols.str">
-    <xsl:choose>
-      <xsl:when test="following-sibling::entry|following-sibling::entrytbl">X</xsl:when>
-      <xsl:otherwise>
-        <xsl:call-template name="has-more-td">
-          <xsl:with-param name="spans" select="$following.spans"/>
-          <xsl:with-param name="col" select="$col+$entry.colspan"/>
-        </xsl:call-template>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-
   <xsl:variable name="rowsep">
     <xsl:choose>
       <!-- If this is the last row, rowsep never applies. -->
-      <xsl:when test="not(ancestor-or-self::row/following-sibling::row
+      <xsl:when test="not(ancestor-or-self::row[1]/following-sibling::row
                           or ancestor-or-self::thead/following-sibling::tbody
                           or ancestor-or-self::tbody/preceding-sibling::tfoot)">
         <xsl:value-of select="0"/>
@@ -365,7 +353,7 @@ to be incomplete. Don't forget to read the source, too :-)</para>
   <xsl:variable name="colsep">
     <xsl:choose>
       <!-- If this is the last column, colsep never applies. -->
-      <xsl:when test="$more.cols.str = ''">0</xsl:when>
+      <xsl:when test="$following.spans = ''">0</xsl:when>
       <xsl:otherwise>
         <xsl:call-template name="inherited.table.attribute">
           <xsl:with-param name="entry" select="."/>
index 7895f4a37b47edaa76f49dbce6d5118e3a423746..2ec97b60cb26415be87216a1d6c7f101d429d7da 100644 (file)
@@ -29,7 +29,7 @@
   <xsl:variable name="rowsep">
     <xsl:choose>
       <!-- If this is the last row, rowsep never applies. -->
-      <xsl:when test="not(ancestor-or-self::row/following-sibling::row
+      <xsl:when test="not(ancestor-or-self::row[1]/following-sibling::row
                           or ancestor-or-self::thead/following-sibling::tbody
                           or ancestor-or-self::tbody/preceding-sibling::tfoot)">
         <xsl:value-of select="0"/>
     </xsl:call-template>
   </xsl:variable>
 
-  <xsl:variable name="more.cols.str">
-    <xsl:choose>
-      <xsl:when test="following-sibling::entry|following-sibling::entrytbl">X</xsl:when>
-      <xsl:otherwise>
-        <xsl:call-template name="has-more-td">
-          <xsl:with-param name="spans" select="$following.spans"/>
-          <xsl:with-param name="col" select="$col+$entry.colspan"/>
-        </xsl:call-template>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-
   <xsl:variable name="rowsep">
     <xsl:choose>
       <!-- If this is the last row, rowsep never applies. -->
-      <xsl:when test="not(ancestor-or-self::row/following-sibling::row
+      <xsl:when test="ancestor::entrytbl
+                      and not (ancestor-or-self::row[1]/following-sibling::row)">
+        <xsl:value-of select="0"/>
+      </xsl:when>
+      <xsl:when test="not(ancestor-or-self::row[1]/following-sibling::row
                           or ancestor-or-self::thead/following-sibling::tbody
                           or ancestor-or-self::tbody/preceding-sibling::tfoot)">
         <xsl:value-of select="0"/>
   <xsl:variable name="colsep">
     <xsl:choose>
       <!-- If this is the last column, colsep never applies. -->
-      <xsl:when test="$more.cols.str = ''">0</xsl:when>
+      <xsl:when test="$following.spans = ''">0</xsl:when>
       <xsl:otherwise>
         <xsl:call-template name="inherited.table.attribute">
           <xsl:with-param name="entry" select="."/>