[xquery-talk] Results from previous iterations
vyacheslav.zholudev at gmail.com
Wed Nov 10 00:57:59 PST 2010
probably a simple question, but playing around didn't bring me any positive results.
My intention is to pass the result of a particular iteration of a for loop to the next iteration, sth, like
let $val := 1 return
for $i in 1 to 10 return
let $val := local:plus-one($val) return $val
where local:plus-one increments the value by 1. So the desired results would be (2, 3, 4..., 10), but in practice of course (2,2,2...,2)
I know that it's against the "side-effect free" design in XQuery, but are there any common patterns to simulate something like this?
Thanks a lot in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the talk