This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: using position to change row colors
- To: xsl-list at lists dot mulberrytech dot com
- Subject: RE: [xsl] using position to change row colors
- From: Jarno dot Elovirta at nokia dot com
- Date: Tue, 13 Nov 2001 06:27:49 +0200
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi
> <xsl:for-each select="Aps:VpmResultSet/Aps:PartStructure">
> <xsl:for-each select="xalan:evaluate($Name)">
> <tr>
> <xsl:choose>
> <xsl:when test="position() mod 2 = 0">
> <xsl:attribute name="class">dark</xsl:attribute>
> </xsl:when>
> <xsl:when test="position() mod 2 = 1">
> <xsl:attribute name="class">light</xsl:attribute>
> </xsl:when>
> </xsl:choose>
Here you're testing the position() of inner for-each and in your example
it's always 1. Use a variable to store the context position and then test
that.
Jarno
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list