Hi,

I have written following query to update an xml object in the database. I'm 
having a list of identifier through which I'm searching in the database and 
then running a xmdp:node-replace to update a specific node in the xml object.

let $ids as xs:unsignedLong* := (10162678676345359985 ,10162678676345359985 
,10230831725188929784 ,...)(: the count of the ids is 320)
let $updated-obj := for $id in $ids
                   let $xmlObj := (/nmsp:xml-object)[(dc:identifier eq $id) and 
(nmsp:object-name eq "SOMEOBJECTNAME")]
                   return if($xmlObj) then xdmp:eval('  declare namespace html 
= "http://www.w3.org/1999/xhtml";;
                                                                                
                              declare namespace nmsp="http://namespace";;
                                                                                
                              declare namespace 
dc="http://purl.org/dc/elements/1.1/";;
                                                                                
                              declare namespace 
dcterms="http://purl.org/dc/terms/";;

                                       declare variable $xmlObj external;

                                      ( xdmp:node-replace($xmlObj / 
nmsp:object-name, < nmsp:object-name >NEWOBJECTNAME</ nmsp:object-name 
>),"replaced")',
                         (xs:QName("xmlObj "), $ xmlObj))
                                                                                
                else()

return $updated-obj

While running this query I'm getting "Cannot update external nodes". Does any 
one have any clue why this error would come.

Thanks in advance

Thanks,
Sriram Gampa
_______________________________________________
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to