[xquery-talk] Problem with "let" statements in an xquery function
andrew.j.welch at gmail.com
Wed Aug 13 12:20:47 PDT 2008
2008/8/12 Ignacio Tripodi <ignaciot at gmail.com>:
> I'm puzzled about this function I'm working on:
> declare updating function
> $a as element(),
> $b as xs:string
> let $c := $a//some_element[.=$b]/..[another_elem='foo']
> let $d := $a//anoher/element
> if( exists($c) )
> replace value of node $c/xxx with $d
> 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:
> 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.
That line is almost certainly the problem... what are you trying to do there?
More information about the talk