XQuery: "Children of an ExprInstruction must..."
The Saxon XSLT and XQuery processor, developed by Saxonica
Brought to you by:
mhkay
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.