]> granicus.if.org Git - docbook-dsssl/commitdiff
Fix bug #1298 where @rowheader = 'firstcol' incorrectly assigns
authorBob Stayton <bobs@sagehill.net>
Mon, 20 Jan 2014 19:54:56 +0000 (19:54 +0000)
committerBob Stayton <bobs@sagehill.net>
Mon, 20 Jan 2014 19:54:56 +0000 (19:54 +0000)
<th> to cell that is first in a row but not the first column due
to row span above.

xsl/html/table.xsl

index c8969924e2e0616ab6e3dc6f63fe39eac413bbcc..f3df9320cf23e756cecaf0c7eb2394cc4342de22 100644 (file)
 
   <xsl:param name="spans"/>
 
-  <xsl:variable name="cellgi">
-    <xsl:choose>
-      <xsl:when test="ancestor::thead">th</xsl:when>
-      <xsl:when test="ancestor::tfoot">th</xsl:when>
-      <xsl:when test="ancestor::tbody and 
-                      (ancestor::table[@rowheader = 'firstcol'] or
-                      ancestor::informaltable[@rowheader = 'firstcol']) and
-                      ancestor-or-self::entry[1][count(preceding-sibling::entry) = 0]">
-        <xsl:text>th</xsl:text>
-      </xsl:when>
-      <xsl:otherwise>td</xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-
   <xsl:variable name="empty.cell" select="count(node()) = 0"/>
 
   <xsl:variable name="named.colnum">
     </xsl:call-template>
   </xsl:variable>
 
+  <xsl:variable name="cellgi">
+    <xsl:choose>
+      <xsl:when test="ancestor::thead">th</xsl:when>
+      <xsl:when test="ancestor::tfoot">th</xsl:when>
+      <xsl:when test="ancestor::tbody and 
+                      (ancestor::table[@rowheader = 'firstcol'] or
+                      ancestor::informaltable[@rowheader = 'firstcol']) and
+                      $entry.colnum = 1">
+        <xsl:text>th</xsl:text>
+      </xsl:when>
+      <xsl:otherwise>td</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
   <xsl:variable name="rowsep">
     <xsl:choose>
       <!-- If this is the last row, rowsep never applies. -->