]> granicus.if.org Git - docbook-dsssl/commitdiff
Make inherited attributes work for 'missing' table cells
authorNorman Walsh <ndw@nwalsh.com>
Wed, 28 Aug 2002 10:30:56 +0000 (10:30 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Wed, 28 Aug 2002 10:30:56 +0000 (10:30 +0000)
xsl/common/table.xsl
xsl/fo/table.xsl
xsl/html/table.xsl

index f147bfdc8c2b85f0338edee7474425077ad4ae2f..515d8857a287c401a160f3b156aedb9a76d160ee 100644 (file)
@@ -230,6 +230,7 @@ or 0 (the empty string)</para>
 
 <xsl:template name="inherited.table.attribute">
   <xsl:param name="entry" select="."/>
+  <xsl:param name="tgroup" select="$entry/ancestor::tgroup[1]"/>
   <xsl:param name="colnum" select="0"/>
   <xsl:param name="attribute" select="'colsep'"/>
 
@@ -251,9 +252,9 @@ or 0 (the empty string)</para>
     <xsl:if test="$entry/@spanname">
       <xsl:variable name="spanname" select="$entry/@spanname"/>
       <xsl:variable name="spanspec"
-                    select="$entry/ancestor::tgroup/spanspec[@spanname=$spanname]"/>
+                    select="$tgroup/spanspec[@spanname=$spanname]"/>
       <xsl:variable name="span.colspec"
-                    select="$entry/ancestor::tgroup/colspec[@colname=$spanspec/@namest]"/>
+                    select="$tgroup/colspec[@colname=$spanspec/@namest]"/>
 
       <xsl:variable name="spanspec.value">
         <xsl:call-template name="get-attribute">
@@ -285,7 +286,7 @@ or 0 (the empty string)</para>
     <xsl:if test="$entry/@namest">
       <xsl:variable name="namest" select="$entry/@namest"/>
       <xsl:variable name="colspec"
-                    select="$entry/ancestor::tgroup/colspec[@colname=$namest]"/>
+                    select="$tgroup/colspec[@colname=$namest]"/>
 
       <xsl:variable name="namest.value">
         <xsl:call-template name="get-attribute">
@@ -305,7 +306,7 @@ or 0 (the empty string)</para>
 
   <xsl:variable name="tgroup.value">
     <xsl:call-template name="get-attribute">
-      <xsl:with-param name="element" select="$entry/ancestor::tgroup[1]"/>
+      <xsl:with-param name="element" select="$tgroup"/>
       <xsl:with-param name="attribute" select="$attribute"/>
     </xsl:call-template>
   </xsl:variable>
@@ -318,12 +319,12 @@ or 0 (the empty string)</para>
         <xsl:value-of select="$tgroup.value"/>
       </xsl:when>
       <xsl:when test="$attribute = 'rowsep'">
-        <xsl:if test="$entry/ancestor::tgroup[1]/parent::*/@frame = 'all'">
+        <xsl:if test="$tgroup/parent::*/@frame = 'all'">
           <xsl:value-of select="1"/>
         </xsl:if>
       </xsl:when>
       <xsl:when test="$attribute = 'colsep'">
-        <xsl:if test="$entry/ancestor::tgroup[1]/parent::*/@frame = 'all'">
+        <xsl:if test="$tgroup/parent::*/@frame = 'all'">
           <xsl:value-of select="1"/>
         </xsl:if>
       </xsl:when>
index 6bddad5c20014d66cac893053912402724cd7bf2..0adc1462f3f24bb0946efb26dfd18593588fab70 100644 (file)
@@ -61,11 +61,10 @@ to be incomplete. Don't forget to read the source, too :-)</para>
 <xsl:template name="empty.table.cell">
   <xsl:param name="colnum" select="0"/>
 
-  <xsl:variable name="frame" select="ancestor::tgroup/parent::*/@frame"/>
-
   <xsl:variable name="rowsep">
     <xsl:call-template name="inherited.table.attribute">
       <xsl:with-param name="entry" select="NOT-AN-ELEMENT-NAME"/>
+      <xsl:with-param name="tgroup" select="ancestor::tgroup"/>
       <xsl:with-param name="colnum" select="$colnum"/>
       <xsl:with-param name="attribute" select="'rowsep'"/>
     </xsl:call-template>
@@ -74,6 +73,7 @@ to be incomplete. Don't forget to read the source, too :-)</para>
   <xsl:variable name="colsep">
     <xsl:call-template name="inherited.table.attribute">
       <xsl:with-param name="entry" select="NOT-AN-ELEMENT-NAME"/>
+      <xsl:with-param name="tgroup" select="ancestor::tgroup"/>
       <xsl:with-param name="colnum" select="$colnum"/>
       <xsl:with-param name="attribute" select="'colsep'"/>
     </xsl:call-template>
@@ -98,7 +98,8 @@ to be incomplete. Don't forget to read the source, too :-)</para>
       </xsl:call-template>
     </xsl:if>
 
-    <fo:block/> <!-- fo:table-cell should not be empty -->
+    <!-- fo:table-cell should not be empty -->
+    <fo:block/>
   </fo:table-cell>
 </xsl:template>
 
index 3de6470ed5fa2a36049bb50f343ce9165c3ef924..7b1d2d666d9e24d3568095f270a4d301df54ed6f 100644 (file)
@@ -29,6 +29,7 @@
   <xsl:variable name="rowsep">
     <xsl:call-template name="inherited.table.attribute">
       <xsl:with-param name="entry" select="NOT-AN-ELEMENT-NAME"/>
+      <xsl:with-param name="tgroup" select="ancestor::tgroup"/>
       <xsl:with-param name="colnum" select="$colnum"/>
       <xsl:with-param name="attribute" select="'rowsep'"/>
     </xsl:call-template>
@@ -37,6 +38,7 @@
   <xsl:variable name="colsep">
     <xsl:call-template name="inherited.table.attribute">
       <xsl:with-param name="entry" select="NOT-AN-ELEMENT-NAME"/>
+      <xsl:with-param name="tgroup" select="ancestor::tgroup"/>
       <xsl:with-param name="colnum" select="$colnum"/>
       <xsl:with-param name="attribute" select="'colsep'"/>
     </xsl:call-template>