Hi List,I was working on multi replacement in Word docx.I saw a strange behavior of "copy/modify".I modified a document.xml and zip my folder content twice when I realized my template was wrong. I had to do it again and, after a hundred tries, I realized that copy/modify clause restored every time the old version of my content.I had to close basexGui and relaunch it to have my changes taken in charge.Hi List,I was working on multi replacement in Word docx.I saw a strange behavior of "copy/modify".I modified a document.xml and zip my folder content twice when I realized my template was wrong. I had to do it again and, after a hundred tries, I realized that copy/modify clause restored every time the old version of my content.I had to close basexGui and relaunch it to have my changes taken in charge.Hi List,I was working on multi replacement in Word docx.I saw a strange behavior of "copy/modify".Here is the fact:I use Basex to modify document.xml then zip its folder in a docx file. After a few try, I needed to modify the original and start the process again. But it always zipped back the elder document.xml version I had corrected ... and deleted (I mean, the text inside $doc was the elder version, see infra). I had to close basexGui and relaunch it to have my new file taken in charge. And I have to do this every time I modify the original docx file.Here is the code :declare function local:mapp($path,$space){for $x at $count in file:list($path)order by $x descendingreturnif (file:is-dir($path||'/'||$x))thenlet $s := count(analyze-string($path||$x,'/')//fn:match)return<zip:dir name = "{replace($x,'/$','')}">{local:mapp($path||'/'||$x,$s)}</zip:dir>else<zip:entry name="{$x}" src="{$path}/{$x}"/>};for $x in file:read-text-lines('liste.txt')returncopy $doc := doc("/document.xml")modifyfor $w in $doc//w:t[.//text() contains text 'XXXXX'] returnreplace value of node $w with replace($w,'XXXXX',$x)return(file:write("document.xml",$doc),let $rep := "/docx"let $dest := "/tmp"returnzip:zip-file(<file xmlns="http://expath.org/ns/zip" href="{$dest}/courrier{$count}.docx">{local:mapp($rep,1)}</file>))All the best,X--Ce message peut contenir des informations réservées exclusivement à son destinataire. Toute diffusion sans autorisation est interdite. Si vous n'en êtes pas le destinataire, merci de prendre contact avec l'expéditeur et de détruire ce message.
This email may contain material for the sole use of the intended recipient. Any forwarding without express permission is prohibited. If you are not the intended recipient, please contact the sender and delete all copies.--Ce message peut contenir des informations réservées exclusivement à son destinataire. Toute diffusion sans autorisation est interdite. Si vous n'en êtes pas le destinataire, merci de prendre contact avec l'expéditeur et de détruire ce message.
This email may contain material for the sole use of the intended recipient. Any forwarding without express permission is prohibited. If you are not the intended recipient, please contact the sender and delete all copies.--Ce message peut contenir des informations réservées exclusivement à son destinataire. Toute diffusion sans autorisation est interdite. Si vous n'en êtes pas le destinataire, merci de prendre contact avec l'expéditeur et de détruire ce message.
This email may contain material for the sole use of the intended recipient. Any forwarding without express permission is prohibited. If you are not the intended recipient, please contact the sender and delete all copies.