Reputation: 2230
When I try to update a node using the XQuery below I get the error:
XDMP-UPCONSTNODES: xdmp:node-replace(...) "Cannot Update constructed nodes"
let $_ := xdmp:node-replace($mydoc/docVersions, $otherVersions)
Upvotes: 2
Views: 1439
Reputation: 2230
This is because the built in node-replace doesn't work on in-memory documents.
You can use the in-mem-update.xqy versions to do this.
import module namespace mem = "http://xqdev.com/in-mem-update" at '/MarkLogic/appservices/utils/in-mem-update.xqy';
let $_ := mem:node-replace($mydoc/docVersions, $otherVersions)
Upvotes: 4