<div dir="ltr">Hi,<br><br>I'm puzzled about this function I'm working on:<br><br>declare updating function<br> do_stuff<br>(<br> $a as element(),<br> $b as xs:string<br>)<br>{<br> let $c := $a//some_element[.=$b]/..[another_elem='foo']<br>
let $d := $a//anoher/element<br><br> return<br> if( exists($c) )<br> then<br> replace value of node $c/xxx with $d<br> else<br> ()<br>};<br><br>The problem is, those "let" statements aren't working... if I check the value of $c or $d they're null. And the xpath expression I'm using is valid. Based on the W3 specs I understand those "let" declarations are valid:<br>
<br><a href="http://www.w3.org/TR/2008/CR-xquery-update-10-20080801/#doc-xquery-FunctionDecl">http://www.w3.org/TR/2008/CR-xquery-update-10-20080801/#doc-xquery-FunctionDecl</a><br><br>What am I missing? Should I assign those variables in some other way? I tried using "declare variable" instead but that didn't work either.<br>
Thanks for any comments, I think I could use an extra pair of eyes. :-)<br><br>-i<br><br><br><br></div>