1

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)
79E09796
  • 2,120
  • 1
  • 20
  • 33
  • http://stackoverflow.com/questions/13583130/what-are-in-memory-elements-in-marklogic – mblakele Aug 14 '14 at 16:42
  • 1
    If you're trying to boost the findability of this answer, include the error code `XDMP-UPCONSTNODES` - or whatever error code you see. – mblakele Aug 14 '14 at 18:57

1 Answers1

4

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)
79E09796
  • 2,120
  • 1
  • 20
  • 33