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

Subject: Re: [xsl] Effective boolean value is not defined for a sequence of two or more items starting with a numeric value
From: "Vyacheslav Sedov" <vyacheslav.sedov@xxxxxxxxx>
Date: Tue, 15 Apr 2008 17:17:35 +0400
thanks for all,

very funny - look like Marklogic XML database engine can understand
syntax like sequence[1,3,5,7] - but since ML still support only draft
of XQuery 1.0 specification, i can suggest that this possibility was
initially present but then removed from final recommendation of XPath
2.0.

so, where can i see discussion about this part of specification? i am
sure that it was smart idea and have rational explanation - just need
to see logic chain (maybe i can meet some new nice ideas about this
theme).

With best wishes,
Slav

On Tue, Apr 15, 2008 at 3:54 PM, Andrew Welch <andrew.j.welch@xxxxxxxxx> wrote:
> 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