[xquery-talk] Results from previous iterations
Daniela Florescu
dflorescu at mac.com
Tue Nov 16 20:57:04 PST 2010
That might help
http://www.w3.org/TR/xquery-sx-10/
Allows variables assignment.
Best
Dana
On Nov 9, 2010, at 3:57 PM, Vyacheslav Zholudev wrote:
> Hi all,
>
> 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!
>
> Vyacheslav
>
>
>
> _______________________________________________
> talk at x-query.com
> http://x-query.com/mailman/listinfo/talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://x-query.com/pipermail/talk/attachments/20101116/3a895127/attachment.htm
More information about the talk
mailing list