Altova Mailing List Archives
>xsl-list Archive Home
>Recent entries
>Thread Prev - [xsl] Borders on column groups
>Thread Next - Re: [xsl] Borders on column groups
Re: [xsl] Borders on column groups
To:
Date: 6/7/2002 2:30:00 AM
At 00:15 2002-06-07 +0100, you wrote:
David wrote:
>don't you only want the rule to be drawn if the col is the last in its
>colgroup (and it's not the last colgroup) anyway if so that's something
>like (untested)
Thank you. It sounds right, but there's still something missing. Here's the
code for table header cells:
<!-- Table header cell -->
<xsl:template match="th">
<xsl:variable name="x" select="position()"/>
<fo:table-cell xsl:use-attribute-sets="table-padding">
<!-- Handle the rules attribute for 'groups' -->
<xsl:if test="ancestor::table[@rules='groups']">
<xsl:attribute name="border-bottom">
<xsl:value-of select="$border"/>
</xsl:attribute>
<xsl:if test="ancestor::table//col[$x]
[not(following-sibling::col) and
parent::colgroup/following-sibling::colgroup]">
<xsl:attribute name="border-right">
<xsl:value-of select="$border"/>
</xsl:attribute>
</xsl:if>
</xsl:if>
<!-- Handle the rules attribute for 'all' -->
<xsl:if test="ancestor::table[@rules='all']">
<xsl:attribute name="border-bottom">
<xsl:value-of select="$border"/>
</xsl:attribute>
<xsl:if test="ancestor::table//col[$x]
[parent::colgroup/following-sibling::colgroup]">
<xsl:attribute name="border-right">
<xsl:value-of select="$border"/>
</xsl:attribute>
</xsl:if>
</xsl:if>
<fo:block xsl:use-attribute-sets="table-header">
<xsl:value-of select="$x"/>
<!-- <xsl:apply-templates/> -->
</fo:block>
</fo:table-cell>
</xsl:template>
I changed <xsl:apply-templates/> to the value of $x to see what's
happening, and the result is even numbers (2, 4, 6 and 8) in the header
row. The variable $x should count all occurencies of <th> elements in the
current <tr>, shouldn't it? I had expected 1, 2, 3 and 4.
Gustaf
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-listDisclaimer
These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

