Subject: RE: Using XSl:Variable and XSL:if together.
From: <Jarno.Elovirta@xxxxxxxxx>
Date: Thu, 1 Apr 2004 09:49:11 +0300
|
FAQ,
> oh. I just realized that Variable value cann't be reset once
> it is defined.
>
> So, is there a alternative way where I can do different
> operation depending on the position of node(element) to be
> even or odd.
<xsl:choose>
<xsl:when test="position() mod 2 = 1">
...
<xsl:when>
<xsl:otherwise>
...
</xsl:otherwise>
<xsl:choose>
or if you can't use position, you have to count the preceding nodes yourself.
Cheers,
Jarno
|