Subject: position() seems always to be 1
From: "Steve" <Turnhose_alt@xxxxxxx>
Date: Tue, 27 May 2003 11:54:41 +0200
|
Hy,
I have a little position() problem and here is what I like to do:
I have sect elements with download elements in it, now I want to format each last download inside each sect in another way.
And here is what I tried but doesn't work, it always uses the otherwise formatting:
<xsl:template match="sect/download">
...
<xsl:choose>
<xsl:when test="self::node()[position()=last()]">
<tr id="downloadBox">
<td width="130" height="1" colspan="3"><img src="img/others/spacer.gif" height="1" width="130"/></td>
</tr>
</xsl:when>
<xsl:otherwise>
<tr id="downloadBox">
<td width="130" height="1" colspan="3" bgcolor="#006699"><img src="img/others/spacer.gif" height="1" width="130"/></td>
</tr>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
If I use <xsl:when test="self::node()[position()=1]"> all download elements are processed, it seems that every download elements returns 1... but this cannot be or?
Thanks for your help.
Steve
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|