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 06:18:08
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(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com> wrote:
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>
 --~--



--~------------------------------------------------------------------
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>
--~--