Stephen Welker wrote:
> I have a problem with following XSL code...
>
> <xsl:template match="sub-section">
> <DIV>
> <xsl:if test="number(/text/sub-section-hilite)">
>
Try adding some output here!
> <xsl:if test="position() mod 2 = 0">
And here for good measure!
>
> <xsl:attribute name="CLASS">subsectionhilite</xsl:attribute>
> </xsl:if>
> </xsl:if>
> <xsl:apply-templates mode="sub-section"/>
> </DIV>
> </xsl:template>
>
> It is based on the following code snippet from W3C.
>
> <xsl:template match="item">
> <tr>
> <xsl:if test="position() mod 2 = 0">
> <xsl:attribute name="bgcolor">yellow</xsl:attribute>
> </xsl:if>
> <xsl:apply-templates/>
> </tr>
> </xsl:template>
>
> My problem is that the test="position() mod 2 = 0" evaluates to true all
> the time.
>
> My XML has more than 1 "sub-section" node (common parent) and is well
> formed.
>
> Any suggestions?
>
> Is "mod" implemented?
Yes, mod is implemented, are you sure that the nested if is processed?
--
Mark McLaren
Viva Napster