Discussion:
Grouping Scope and counters
(too old to reply)
Ihe Onwuka
2014-05-24 07:05:32 UTC
Permalink
for $x at $i in blah
group by $x/@a
return
if ($i mod 10000 eq 0) then ..... else .....


Now the problem is that XQuery (of the eXist variety) denies knowledge of
the existence of the $i variable in the return clause. Presumably this is
because the group construct interferes with the lexical scoping.

I do not have to do this with XQuery as I can solve it downstream but I
would be interested in learning more about this scenario.
w***@public.gmane.org
2014-05-24 10:32:16 UTC
Permalink
Now the problem is that XQuery (of the eXist variety) denies knowledge of the existence of the $i variable in the return clause.
Yes, the original implementor left a todo comment in the code ;-) The $i variable should be in scope. I’ve just submitted a pull request for this.

Wolfgang

Continue reading on narkive:
Loading...