Christian,
I encountered some unexpected behavior with the typecasting of functionresult. it is about the "?" in line 4 of both snippets. [expectedResult.xq], the snippet with the " ?" gives the expected result. [unexpectedResult.xq], the snipped without the "?" , gives an unexpected result.
Is this a correct observation or am I missing something?
mvgr.
Rob Stapper
Hi Rob,
The spec allows processors to optimize code by taking advantage the supplied type information. For example, the following code…
let $a as element() := <a/>[. = 'x'] return empty($a)
…can (and will) be simplified to a static false() – both by BaseX and Saxon, and possibly other processors – because $a is typed to be a single element.
Hope this helps, Christian
basex-talk@mailman.uni-konstanz.de