[xquery-talk] "to" operator

Birnbaum, David J djbpitt at pitt.edu
Wed Feb 22 18:04:43 PST 2012

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,
  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?


djbpitt at gmail.com

More information about the talk mailing list