xsl-list
[Top] [All Lists]

Re: [xsl] Effective boolean value is not defined for a sequence of two or more items starting with a numeric value

2008-04-15 04:55:05
On 15/04/2008, Vyacheslav Sedov <vyacheslav(_dot_)sedov(_at_)gmail(_dot_)com> 
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/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--