Menu

#227 XQuery: "Children of an ExprInstruction must..."

v8.0
closed
5
2012-10-08
2004-06-28
Michael Kay
No

In XQuery, certain constructs give rise to the error
message "Children of an ExprInstruction must themselves
be ExprInstructions". This indicates that incorrect
code has been generated by the query parser. It happens
for example when a FLWR expression is used directly
within an element constructor, as in:

element {substring("e",1,1)} {let $f := <f/> return $f}

(In this example, changing either of the two
expressions in curly braces to something simpler fixes
the problem!)

It is usually possible to circumvent the problem by
replacing the expression inside the element constructor
with a reference to a variable declared outside it.

Discussion