I'm trying to change the value of several nodes in a very big XML file loaded in memory from a web form.
The file is obtained like this:
let $file := xdmp:get-request-field("xml_to_upload")
So, as you can see the file is in memory.
Now, I need to change the value of thousands of nodes, and so far I haven't been able to do it in an optimal way.
Any ideas?
Some of the things I've tryied so far:
let $auxVar :=
if($fileStructureIsValid) then
(
for $currentNode in xdmp:unquote($file)//ID
let $log := xdmp:log( fn:concat( "newNodeValue", ": ", mem:replace( $currentNode, element ID{ fn:concat( $subject, "-", fn:data( $currentNode ) ) } ) ) )
return fn:concat( $subject, "-", fn:data( $currentNode ) )
)
else
(
)
The mem library is a custom downloaded one.