select="$entry/ancestor::tgroup/colspec[@colname=$namest]"/>
</xsl:call-template>
</xsl:variable>
+
<xsl:variable name="ecol">
<xsl:call-template name="colspec.colnum">
<xsl:with-param name="colspec"
select="$entry/ancestor::tgroup/colspec[@colname=$nameend]"/>
</xsl:call-template>
</xsl:variable>
- <xsl:value-of select="$ecol - $scol + 1"/>
-</xsl:template>
-
-<xsl:template name="X.calculate.rowsep">
- <xsl:param name="entry" select="."/>
- <xsl:param name="colnum" select="0"/>
<xsl:choose>
- <xsl:when test="$entry/ancestor::table/@frame = 'all'
- or $entry/ancestor::informaltable/@frame = 'all'">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 test="$namest != '' and $nameend != ''">
+ <xsl:choose>
+ <xsl:when test="$ecol >= $scol">
+ <xsl:value-of select="$ecol - $scol + 1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$scol - $ecol + 1"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
+ <xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:param name="entry" select="."/>
<xsl:param name="colnum" select="0"/>
+ <xsl:call-template name="inherited.table.attribute">
+ <xsl:with-param name="entry" select="$entry"/>
+ <xsl:with-param name="colnum" select="$colnum"/>
+ <xsl:with-param name="attribute" select="'rowsep'"/>
+ </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:param name="entry" select="."/>
<xsl:param name="colnum" select="0"/>
+ <xsl:call-template name="inherited.table.attribute">
+ <xsl:with-param name="entry" select="$entry"/>
+ <xsl:with-param name="colnum" select="$colnum"/>
+ <xsl:with-param name="attribute" select="'colsep'"/>
+ </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:choose>
</xsl:template>
+<xsl:template name="inherited.table.attribute">
+ <xsl:param name="entry" select="."/>
+ <xsl:param name="colnum" select="0"/>
+ <xsl:param name="attribute" select="'colsep'"/>
+
+ <xsl:variable name="entry.value">
+ <xsl:call-template name="get-attribute">
+ <xsl:with-param name="element" select="$entry"/>
+ <xsl:with-param name="attribute" select="$attribute"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="row.value">
+ <xsl:call-template name="get-attribute">
+ <xsl:with-param name="element" select="$entry/ancestor::row[1]"/>
+ <xsl:with-param name="attribute" select="$attribute"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="span.value">
+ <xsl:if 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:variable name="spanspec.value">
+ <xsl:call-template name="get-attribute">
+ <xsl:with-param name="element" select="$spanspec"/>
+ <xsl:with-param name="attribute" select="$attribute"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="scolspec.value">
+ <xsl:call-template name="get-attribute">
+ <xsl:with-param name="element" select="$span.colspec"/>
+ <xsl:with-param name="attribute" select="$attribute"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="$spanspec.value != ''">
+ <xsl:value-of select="$spanspec.value"/>
+ </xsl:when>
+ <xsl:when test="$scolspec.value != ''">
+ <xsl:value-of select="$scolspec.value"/>
+ </xsl:when>
+ <xsl:otherwise></xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:variable>
+
+ <xsl:variable name="namest.value">
+ <xsl:if test="$entry/@namest">
+ <xsl:variable name="namest" select="$entry/@namest"/>
+ <xsl:variable name="colspec"
+ select="$entry/ancestor::tgroup/colspec[@colname=$namest]"/>
+
+ <xsl:variable name="namest.value">
+ <xsl:call-template name="get-attribute">
+ <xsl:with-param name="element" select="$colspec"/>
+ <xsl:with-param name="attribute" select="$attribute"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="$namest.value">
+ <xsl:value-of select="$namest.value"/>
+ </xsl:when>
+ <xsl:otherwise></xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:variable>
+
+ <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="attribute" select="$attribute"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="$entry.value != ''">
+ <xsl:value-of select="$entry.value"/>
+ </xsl:when>
+ <xsl:when test="$row.value != ''">
+ <xsl:value-of select="$row.value"/>
+ </xsl:when>
+ <xsl:when test="$span.value">
+ <xsl:value-of select="$span.value"/>
+ </xsl:when>
+ <xsl:when test="$namest.value">
+ <xsl:value-of select="$namest.value"/>
+ </xsl:when>
+ <xsl:when test="$colnum > 0">
+ <xsl:variable name="calc.colvalue">
+ <xsl:call-template name="colnum.colspec">
+ <xsl:with-param name="colnum" select="$colnum"/>
+ <xsl:with-param name="attribute" select="$attribute"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$calc.colvalue != ''">
+ <xsl:value-of select="$calc.colvalue"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$tgroup.value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$tgroup.value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
<xsl:template name="colnum.colspec">
<xsl:param name="colnum" select="0"/>
<xsl:param name="attribute" select="'colname'"/>
<xsl:param name="colnum" select="0"/>
<xsl:variable name="rowsep">
- <xsl:call-template name="calculate.rowsep">
+ <xsl:call-template name="inherited.table.attribute">
<xsl:with-param name="entry" select="NOT-AN-ELEMENT-NAME"/>
<xsl:with-param name="colnum" select="$colnum"/>
+ <xsl:with-param name="attribute" select="'rowsep'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="colsep">
- <xsl:call-template name="calculate.colsep">
+ <xsl:call-template name="inherited.table.attribute">
<xsl:with-param name="entry" select="NOT-AN-ELEMENT-NAME"/>
<xsl:with-param name="colnum" select="$colnum"/>
+ <xsl:with-param name="attribute" select="'colsep'"/>
</xsl:call-template>
</xsl:variable>
</xsl:call-template>
</xsl:if>
<fo:block>
- <!--
<xsl:text>e(</xsl:text>
<xsl:value-of select="$rowsep"/>
<xsl:text>,</xsl:text>
<xsl:value-of select="$colsep"/>
<xsl:text>)</xsl:text>
- -->
</fo:block>
</fo:table-cell>
</xsl:template>
</xsl:variable>
<xsl:variable name="rowsep">
- <xsl:call-template name="calculate.rowsep">
+ <xsl:call-template name="inherited.table.attribute">
<xsl:with-param name="entry" select="."/>
<xsl:with-param name="colnum" select="$entry.colnum"/>
+ <xsl:with-param name="attribute" select="'rowsep'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="colsep">
- <xsl:call-template name="calculate.colsep">
+ <xsl:call-template name="inherited.table.attribute">
<xsl:with-param name="entry" select="."/>
<xsl:with-param name="colnum" select="$entry.colnum"/>
+ <xsl:with-param name="attribute" select="'colsep'"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="valign">
+ <xsl:call-template name="inherited.table.attribute">
+ <xsl:with-param name="entry" select="."/>
+ <xsl:with-param name="colnum" select="$entry.colnum"/>
+ <xsl:with-param name="attribute" select="'valign'"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="align">
+ <xsl:call-template name="inherited.table.attribute">
+ <xsl:with-param name="entry" select="."/>
+ <xsl:with-param name="colnum" select="$entry.colnum"/>
+ <xsl:with-param name="attribute" select="'align'"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="char">
+ <xsl:call-template name="inherited.table.attribute">
+ <xsl:with-param name="entry" select="."/>
+ <xsl:with-param name="colnum" select="$entry.colnum"/>
+ <xsl:with-param name="attribute" select="'char'"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="charoff">
+ <xsl:call-template name="inherited.table.attribute">
+ <xsl:with-param name="entry" select="."/>
+ <xsl:with-param name="colnum" select="$entry.colnum"/>
+ <xsl:with-param name="attribute" select="'charoff'"/>
</xsl:call-template>
</xsl:variable>
</xsl:attribute>
</xsl:if>
- <xsl:if test="@valign">
+ <xsl:if test="$valign != ''">
<xsl:attribute name="display-align">
<xsl:choose>
- <xsl:when test="@valign='top'">before</xsl:when>
- <xsl:when test="@valign='middle'">center</xsl:when>
- <xsl:when test="@valign='bottom'">after</xsl:when>
+ <xsl:when test="$valign='top'">before</xsl:when>
+ <xsl:when test="$valign='middle'">center</xsl:when>
+ <xsl:when test="$valign='bottom'">after</xsl:when>
+ <xsl:otherwise>
+ <xsl:message>
+ <xsl:text>Unexpected valign value: </xsl:text>
+ <xsl:value-of select="$valign"/>
+ <xsl:text>, center used.</xsl:text>
+ </xsl:message>
+ <xsl:text>center</xsl:text>
+ </xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:if>
- <xsl:if test="@align">
+ <xsl:if test="$align != ''">
<xsl:attribute name="text-align">
- <xsl:value-of select="@align"/>
+ <xsl:value-of select="$align"/>
</xsl:attribute>
</xsl:if>
-<!--
- <xsl:if test="@char">
- <xsl:attribute name="char">
- <xsl:value-of select="@char"/>
+ <xsl:if test="$char != ''">
+ <xsl:attribute name="text-align">
+ <xsl:value-of select="$char"/>
</xsl:attribute>
</xsl:if>
+<!--
<xsl:if test="@charoff">
<xsl:attribute name="charoff">
<xsl:value-of select="@charoff"/>
</xsl:attribute>
</xsl:if>
-
-->
<fo:block>
<xsl:param name="colnum" select="0"/>
<xsl:variable name="rowsep">
- <xsl:call-template name="calculate.rowsep">
+ <xsl:call-template name="inherited.table.attribute">
<xsl:with-param name="entry" select="NOT-AN-ELEMENT-NAME"/>
<xsl:with-param name="colnum" select="$colnum"/>
+ <xsl:with-param name="attribute" select="'rowsep'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="colsep">
- <xsl:call-template name="calculate.colsep">
+ <xsl:call-template name="inherited.table.attribute">
<xsl:with-param name="entry" select="NOT-AN-ELEMENT-NAME"/>
<xsl:with-param name="colnum" select="$colnum"/>
+ <xsl:with-param name="attribute" select="'colsep'"/>
</xsl:call-template>
</xsl:variable>
</xsl:variable>
<xsl:variable name="rowsep">
- <xsl:call-template name="calculate.rowsep">
+ <xsl:call-template name="inherited.table.attribute">
<xsl:with-param name="entry" select="."/>
<xsl:with-param name="colnum" select="$entry.colnum"/>
+ <xsl:with-param name="attribute" select="'rowsep'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="colsep">
- <xsl:call-template name="calculate.colsep">
+ <xsl:call-template name="inherited.table.attribute">
<xsl:with-param name="entry" select="."/>
<xsl:with-param name="colnum" select="$entry.colnum"/>
+ <xsl:with-param name="attribute" select="'colsep'"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="valign">
+ <xsl:call-template name="inherited.table.attribute">
+ <xsl:with-param name="entry" select="."/>
+ <xsl:with-param name="colnum" select="$entry.colnum"/>
+ <xsl:with-param name="attribute" select="'valign'"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="align">
+ <xsl:call-template name="inherited.table.attribute">
+ <xsl:with-param name="entry" select="."/>
+ <xsl:with-param name="colnum" select="$entry.colnum"/>
+ <xsl:with-param name="attribute" select="'align'"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="char">
+ <xsl:call-template name="inherited.table.attribute">
+ <xsl:with-param name="entry" select="."/>
+ <xsl:with-param name="colnum" select="$entry.colnum"/>
+ <xsl:with-param name="attribute" select="'char'"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="charoff">
+ <xsl:call-template name="inherited.table.attribute">
+ <xsl:with-param name="entry" select="."/>
+ <xsl:with-param name="colnum" select="$entry.colnum"/>
+ <xsl:with-param name="attribute" select="'charoff'"/>
</xsl:call-template>
</xsl:variable>
</xsl:attribute>
</xsl:if>
- <xsl:if test="@align">
+ <xsl:if test="$align != ''">
<xsl:attribute name="align">
- <xsl:value-of select="@align"/>
+ <xsl:value-of select="$align"/>
</xsl:attribute>
</xsl:if>
- <xsl:if test="@char">
- <xsl:attribute name="char">
- <xsl:value-of select="@char"/>
+ <xsl:if test="$valign != ''">
+ <xsl:attribute name="valign">
+ <xsl:value-of select="$valign"/>
</xsl:attribute>
</xsl:if>
- <xsl:if test="@charoff">
- <xsl:attribute name="charoff">
- <xsl:value-of select="@charoff"/>
+ <xsl:if test="$char != ''">
+ <xsl:attribute name="char">
+ <xsl:value-of select="$char"/>
</xsl:attribute>
</xsl:if>
- <xsl:if test="@valign">
- <xsl:attribute name="valign">
- <xsl:value-of select="@valign"/>
+ <xsl:if test="$charoff != ''">
+ <xsl:attribute name="charoff">
+ <xsl:value-of select="$charoff"/>
</xsl:attribute>
</xsl:if>
- <xsl:if test="not(preceding-sibling::*)
- and ancestor::row/@id">
+ <xsl:if test="not(preceding-sibling::*) and ancestor::row/@id">
<xsl:call-template name="anchor">
<xsl:with-param name="node" select="ancestor::row[1]"/>
</xsl:call-template>
<xsl:param name="cols" select="1"/>
<xsl:param name="count" select="1"/>
<xsl:choose>
- <xsl:when test="$count>$cols"></xsl:when>
+ <xsl:when test="$count > $cols"></xsl:when>
<xsl:otherwise>
<xsl:call-template name="generate.col">
<xsl:with-param name="countcol" select="$count"/>