[Bug 2921] Provide an exemple of a numeric range used as filter epression

http://www.w3.org/Bugs/Public/show_bug.cgi?id=2921


mike@saxonica.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Provide an exemple of a     |Provide an exemple of a
                   |numeric range used as filter|numeric range used as filter
                   |epression                   |epression




------- Additional Comments From mike@saxonica.com  2006-02-23 09:59 -------
$foo[(2 to 5)] is not a legal expression. It will give you a type error
FORG0006: se the rules for effective boolean value at
http://www.w3.org/TR/xpath20/#id-ebv, which are referred to from the rules for
predicates at http://www.w3.org/TR/xpath20/#id-predicates

There was an example of such a construct in a very early draft of XQuery back in
2001, but it never had any defined semantics.

You can achieve the desired effect by writing

$foo[position()=(2 to 5)]

or if you prefer, by

subsequence($foo, 2, 4)

Michael Kay
(personal response)

Received on Thursday, 23 February 2006 09:59:42 UTC