[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] using position to change row colors


Subject: RE: [xsl] using position to change row colors
From: Jarno.Elovirta@xxxxxxxxx
Date: Tue, 13 Nov 2001 06:27:49 +0200

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



Current Thread