]> granicus.if.org Git - docbook-dsssl/commitdiff
Removed some obsolete templates; reworked inheritance for improved border support...
authorNorman Walsh <ndw@nwalsh.com>
Sun, 12 May 2002 11:29:37 +0000 (11:29 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Sun, 12 May 2002 11:29:37 +0000 (11:29 +0000)
xsl/common/table.xsl

index 01e9694227353bd80098b09aea3d847d541aaaae..f147bfdc8c2b85f0338edee7474425077ad4ae2f 100644 (file)
@@ -217,72 +217,6 @@ or 0 (the empty string)</para>
   </xsl:call-template>
 </xsl:template>
 
-<xsl:template name="X.calculate.rowsep">
-  <xsl:param name="entry" select="."/>
-  <xsl:param name="colnum" select="0"/>
-
-<!--
-  <xsl:text>[</xsl:text>
-  <xsl:value-of select="$colnum"/>
-  <xsl:text>]</xsl:text>
--->
-
-  <xsl:choose>
-    <xsl:when test="$entry/ancestor::table/@frame = 'all'
-                    or $entry/ancestor::informaltable/@frame = 'all'">
-      <xsl:value-of select="1"/>
-    </xsl:when>
-    <xsl:when test="$entry/@rowsep">
-      <xsl:value-of select="$entry/@rowsep"/>
-    </xsl:when>
-    <xsl:when test="$entry/ancestor::row[1]/@rowsep">
-      <xsl:value-of select="$entry/ancestor::row[1]/@rowsep"/>
-    </xsl:when>
-    <xsl:when test="$entry/@spanname">
-      <xsl:variable name="spanname" select="$entry/@spanname"/>
-      <xsl:variable name="spanspec"
-                    select="$entry/ancestor::tgroup/spanspec[@spanname=$spanname]"/>
-      <xsl:variable name="span.colspec"
-                    select="$entry/ancestor::tgroup/colspec[@colname=$spanspec/@namest]"/>
-      <xsl:choose>
-        <xsl:when test="$spanspec/@rowsep">
-          <xsl:value-of select="$spanspec/@rowsep"/>
-        </xsl:when>
-        <xsl:when test="$span.colspec/@rowsep">
-          <xsl:value-of select="$span.colspec/@rowsep"/>
-        </xsl:when>
-        <xsl:otherwise>0</xsl:otherwise>
-      </xsl:choose>
-    </xsl:when>
-    <xsl:when test="$entry/@namest">
-      <xsl:variable name="namest" select="$entry/@namest"/>
-      <xsl:variable name="colspec"
-                    select="$entry/ancestor::tgroup/colspec[@colname=$namest]"/>
-      <xsl:choose>
-        <xsl:when test="$colspec/@rowsep">
-          <xsl:value-of select="$colspec/@rowsep"/>
-        </xsl:when>
-        <xsl:otherwise>0</xsl:otherwise>
-      </xsl:choose>
-    </xsl:when>
-    <xsl:when test="$colnum &gt; 0">
-      <xsl:variable name="calc.rowsep">
-        <xsl:call-template name="colnum.colspec">
-          <xsl:with-param name="colnum" select="$colnum"/>
-          <xsl:with-param name="attribute" select="'rowsep'"/>
-        </xsl:call-template>
-      </xsl:variable>
-      <xsl:choose>
-        <xsl:when test="$calc.rowsep != ''">
-          <xsl:value-of select="$calc.rowsep"/>
-        </xsl:when>
-        <xsl:otherwise>0</xsl:otherwise>
-      </xsl:choose>
-    </xsl:when>
-    <xsl:otherwise>0</xsl:otherwise>
-  </xsl:choose>
-</xsl:template>
-
 <xsl:template name="calculate.colsep">
   <xsl:param name="entry" select="."/>
   <xsl:param name="colnum" select="0"/>
@@ -294,72 +228,6 @@ or 0 (the empty string)</para>
   </xsl:call-template>
 </xsl:template>
 
-<xsl:template name="X.calculate.colsep">
-  <xsl:param name="entry" select="."/>
-  <xsl:param name="colnum" select="0"/>
-
-<!--
-  <xsl:text>[</xsl:text>
-  <xsl:value-of select="$colnum"/>
-  <xsl:text>]</xsl:text>
--->
-
-  <xsl:choose>
-    <xsl:when test="$entry/ancestor::table/@frame = 'all'
-                    or $entry/ancestor::informaltable/@frame = 'all'">
-      <xsl:value-of select="1"/>
-    </xsl:when>
-    <xsl:when test="$entry/@colsep">
-      <xsl:value-of select="$entry/@colsep"/>
-    </xsl:when>
-    <xsl:when test="$entry/ancestor::row[1]/@colsep">
-      <xsl:value-of select="$entry/ancestor::row[1]/@colsep"/>
-    </xsl:when>
-    <xsl:when test="$entry/@spanname">
-      <xsl:variable name="spanname" select="$entry/@spanname"/>
-      <xsl:variable name="spanspec"
-                    select="$entry/ancestor::tgroup/spanspec[@spanname=$spanname]"/>
-      <xsl:variable name="span.colspec"
-                    select="$entry/ancestor::tgroup/colspec[@colname=$spanspec/@namest]"/>
-      <xsl:choose>
-        <xsl:when test="$spanspec/@colsep">
-          <xsl:value-of select="$spanspec/@colsep"/>
-        </xsl:when>
-        <xsl:when test="$span.colspec/@colsep">
-          <xsl:value-of select="$span.colspec/@colsep"/>
-        </xsl:when>
-        <xsl:otherwise>0</xsl:otherwise>
-      </xsl:choose>
-    </xsl:when>
-    <xsl:when test="$entry/@namest">
-      <xsl:variable name="namest" select="$entry/@namest"/>
-      <xsl:variable name="colspec"
-                    select="$entry/ancestor::tgroup/colspec[@colname=$namest]"/>
-      <xsl:choose>
-        <xsl:when test="$colspec/@colsep">
-          <xsl:value-of select="$colspec/@colsep"/>
-        </xsl:when>
-        <xsl:otherwise>0</xsl:otherwise>
-      </xsl:choose>
-    </xsl:when>
-    <xsl:when test="$colnum &gt; 0">
-      <xsl:variable name="calc.colsep">
-        <xsl:call-template name="colnum.colspec">
-          <xsl:with-param name="colnum" select="$colnum"/>
-          <xsl:with-param name="attribute" select="'colsep'"/>
-        </xsl:call-template>
-      </xsl:variable>
-      <xsl:choose>
-        <xsl:when test="$calc.colsep != ''">
-          <xsl:value-of select="$calc.colsep"/>
-        </xsl:when>
-        <xsl:otherwise>0</xsl:otherwise>
-      </xsl:choose>
-    </xsl:when>
-    <xsl:otherwise>0</xsl:otherwise>
-  </xsl:choose>
-</xsl:template>
-
 <xsl:template name="inherited.table.attribute">
   <xsl:param name="entry" select="."/>
   <xsl:param name="colnum" select="0"/>
@@ -442,6 +310,27 @@ or 0 (the empty string)</para>
     </xsl:call-template>
   </xsl:variable>
 
+  <xsl:variable name="default.value">
+    <!-- rowsep and colsep have defaults based ultimately on the frame setting -->
+    <!-- handle those here, for everything else, the default is the tgroup value -->
+    <xsl:choose>
+      <xsl:when test="$tgroup.value != ''">
+        <xsl:value-of select="$tgroup.value"/>
+      </xsl:when>
+      <xsl:when test="$attribute = 'rowsep'">
+        <xsl:if test="$entry/ancestor::tgroup[1]/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:value-of select="1"/>
+        </xsl:if>
+      </xsl:when>
+      <xsl:otherwise><!-- empty --></xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
   <xsl:choose>
     <xsl:when test="$entry.value != ''">
       <xsl:value-of select="$entry.value"/>
@@ -467,12 +356,12 @@ or 0 (the empty string)</para>
           <xsl:value-of select="$calc.colvalue"/>
         </xsl:when>
         <xsl:otherwise>
-          <xsl:value-of select="$tgroup.value"/>
+          <xsl:value-of select="$default.value"/>
         </xsl:otherwise>
       </xsl:choose>
     </xsl:when>
     <xsl:otherwise>
-      <xsl:value-of select="$tgroup.value"/>
+      <xsl:value-of select="$default.value"/>
     </xsl:otherwise>
   </xsl:choose>
 </xsl:template>