Hmm. MarkLogic in its extended XQuery mode supports "Shorthand Positional Predicate Syntax" whereby

        (1, 2, 3, 4, 5, 5)[1 to 3]

is interpreted as a synonym for

        (1, 2, 3, 4, 5, 5)[fn:position() = (1 to 3)]

Is that the case for eXist? But either way, it seems that both queries should either succeed or fail; the discrepancy looks like a bug.

On Wed, 22 Feb 2012, Birnbaum, David J wrote:

Dear x-query list,

Using eXist 2.0-tech-preview-rev15878-20120213 (sandbox), I understand why:

 let $all := collection('/db/twitter')//tweet
 return $all[1 to 10]

returns an error, since a numeric predicate isn't supposed to be a
sequence of more than one atomic value. The error report is:

 err:FORG0006: effectiveBooleanValue: first item of '(1, 2, 3, 4, 5, 6,
7Š'
 is not a node, and sequence length > 1

What I don't understand is why the following *doesn't* return an error:

 let $all := collection('/db/twitter')//tweet
 let $range := 1 to 10
 return $all[$range]

When I run this second FLWOR, I retrieve my first ten tweets.

What am I misunderstanding?

Thanks,

David
[email protected]


_______________________________________________
[email protected]
http://x-query.com/mailman/listinfo/talk


--
David Sewell, Editorial and Technical Manager
ROTUNDA, The University of Virginia Press
PO Box 400314, Charlottesville, VA 22904-4314 USA
Email: [email protected]   Tel: +1 434 924 9973
Web: http://rotunda.upress.virginia.edu/
_______________________________________________
[email protected]
http://x-query.com/mailman/listinfo/talk

Reply via email to