Friday, June 24, 2011

if you are trying to update a variable in a for loop in XQuery, you will face a lot of frustration

if you do this:

let $count := 1

for $bla in $mumble let $count := $count + 1

IT WILL NOT WORK! On the left hand side ot the "let" you will keep updating a local scope variable, while in the right hand side of the "let" you will access the global $count variable declared above the "for"