Hello,
I am doing update using other xml file as resources. I reading in xml
file as a string, then I do
let $new := <?xml version="1.0" encoding="US-ASCII"?><!-- comment here
--><Customer
id="1011"><Mnemonic>BenzmullerLefteris</Mnemonic><ShortNames><ShortName>shortname1</ShortName><ShortName>shortname2</ShortName></ShortNames><Name><Title>Sir</Title><FirstName>Lefteris</FirstName><LastName>Benzmuller</LastName></Name><DateOfBirth>1970-03-02</DateOfBirth><Gender>Male</Gender><Nationality>Syrian
Arab
Republic</Nationality><CountryOfResidence>Belgium</CountryOfResidence><Languages><Language>language1</Language><Language>language2</Language></Languages></Customer>
for $old in doc()
where $old/Customer/@id eq 1003
return (
xdmp:node-replace(doc(fn:document-uri($old))/Customer/ShortNames/ShortName[1],
$new/ShortNames/ShortName[1]),
xdmp:node-replace(doc(fn:document-uri($old))/Customer/Name/Title,
$new/Name/Title)
)
The let clause has unexpected comment tag error, so I delete the version
and comments before passing the string to let clause. Is there any
better way to deal with this? Thank you very much!
Best,
Ling
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general