</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 > 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"/>
</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 > 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"/>
</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"/>
<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>