When I run the following xquery in MarkLogic":
xquery version "1.0-ml";
let $envelope := <envelope xmlns="http://marklogic.com/entity-services">
<info>hello</info>
</envelope>
return fn:data($envelope/es:info)
I receive this error:
[1.0-ml] XDMP-NONMIXEDCOMPLEXCONT: fn:data(hello) -- Node has complex type with non-mixed complex content
Strangely, when I rename the info-node to info1 for instance the code works as expected:
xquery version "1.0-ml";
let $envelope := <envelope xmlns="http://marklogic.com/entity-services">
<info1>hello</info1>
</envelope>
return fn:data($envelope/es:info1)
result is: hello (as expected)
Can someone explain this black magic to me?