Hi Giuseppe,
However, if I change the script into
let $f := page:documents($an1, $an2) return page:open-url($an1)
the function page:open-url($an1) works properly (i.e., the presence of the independent let clause seems to affect the value of the variable $an1): I would not expect this in a functional programming language like XQuery. I have posted a gist here [1], where there are more details (look at the very end of the script)
Could you elaborate on what »works properly« means? What output do you get? Which error do you get in the first case?
Could you possibly provide us with a minimal test case, ideally without the RESTXQ facade?
Thanks in advance, Christian