declarative4all
declarative4all copied to clipboard
Having another FLWOR expression inside 'if' fails
For example running this query inside runany.htm:
let $x := 4
return
if ($x eq 4) then
let $y := 5
return $y
else
7
returns
18:37:54 - fn:error(fn:QName('http://www.w3.org/2005/xqt-errors', 'err:XPST0003'),'Cannot read properties of undefined (reading 'length')')
There are issues in the current parser resulting with this kind of error message.
As a workaround, adding extra parentheses around an embedded FLWOR expression, or an embedded if statement, should help enough the parser and allow evaluation.
A new version of parser is to be committed soon.
Indeed
let $x := 4
return
if ($x eq 4) then
(
let $y := 5
return $y
)
else
7
returns
15:10:37 - xs:integer('5')