This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Last Position Check
- To: Nathan Shaw <n8_shaw at yahoo dot com>
- Subject: Re: [xsl] Last Position Check
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Wed, 18 Jul 2001 17:28:35 +0100
- CC: XSL-List at lists dot mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <20010718161642.42568.qmail@web9802.mail.yahoo.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Nathan,
> I am currently running a check to see if an element is in the last
> position, but it does not seem to be working.
>
> <xsl:if test="not(position()='last')"> | </xsl:if>
You're testing whether the position() of the current node is equal to
the string 'last'. You want to test whether the position() of the
current node is equal to the length of the current node list, which
you can get with a call to the function last():
<xsl:if test="not(position() = last())"> | </xsl:if>
or:
<xsl:if test="position() != last()"> | </xsl:if>
I hope that helps,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list