This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: using position to change row colors


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]