Subject: Re: [xsl] Effective boolean value is not defined for a sequence of two or more items starting with a numeric value From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx> Date: Tue, 15 Apr 2008 12:54:38 +0100 |
On 15/04/2008, Vyacheslav Sedov <vyacheslav.sedov@xxxxxxxxx> wrote: > <xsl:value-of select="string-join((tokenize($uri,'/')[1 to (last()-1)]), '/')"/> Instead of [1 to n] which is really just a sequence of numbers, you really mean: [position() = (1 to n)] which will return true if the item of the left is equal to any item in the sequence on the right. As others have said, [position() = (1 to last() - 1)] is the same as [position() ne last()] ("ne" compares two atomic items, whereas != compares two sets so in this case you know position() and last() are always going to be atomic values so "ne" can be used) It is intuitive though (to me at least), that a predicate containing [1, 3, 5] would select the first , third and fifth items in the sequence... cheers -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Effective boolean value i, Florent Georges | Thread | Re: [xsl] Effective boolean value i, Vyacheslav Sedov |
Re: [xsl] xsl:for-each with dynamic, Martin Honnen | Date | Re: [xsl] xsl:for-each with dynamic, Michael Ludwig |
Month |