This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Borders on row groups
- From: Joerg Heinicke <joerg dot heinicke at gmx dot de>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Thu, 06 Jun 2002 21:09:05 +0200
- Subject: Re: [xsl] Borders on row groups
- References: <3.0.6.32.20020606204132.007eb100@pop.algonet.se>
- Reply-to: xsl-list at lists dot mulberrytech dot com
A row group is a <tbody>. The idea is therefore to have a border-bottom on
<td> elements in the last <tr> in each <tbody>. I tried this:
<!-- Table cell -->
<xsl:template match="td">
<fo:table-cell>
<xsl:if test="parent::tr[position()=last()]">
The predicate is true for all parents - that's your problem. position()
is "relative" to the selected nodes. I.e. with parent::tr you select the
one parent node with name tr and this is always the last of the selected
nodes too. What you want is
<xsl:if test="not(parent::tr/following-sibling::tr)">
Regards,
Joerg
<xsl:attribute name="border-bottom">0.5pt solid black</xsl:attribute>
</xsl:if>
<fo:block><xsl:apply-templates/></fo:block>
</fo:table-cell>
</xsl:template>
The result is that I get border-bottom on every row, and I don't understand
why.
Gustaf
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list