I am using mem:node-replace for replacing the content.But it is taking too much of time.I got a time-out error. Is there any alternative for this?
Find the Sample Xquery:
xquery version "1.0-ml";
declare namespace html = "http://www.w3.org/1999/xhtml";
import module namespace mem = "http://xqdev.com/in-mem-update"
at '/MarkLogic/appservices/utils/in-mem-update.xqy';
let $uri := cts:uri-match((concat('*',$id ,'*')),(),cts:collection-query($collection))
let $data := doc($uri)
let $final := mem:node-replace($data//title[@id='2'],doc($uri1)//title[@id='2'])
return (
xdmp:document-insert('/test/sample.xml',$final)
)