Hi Nicole, That should certainly be possible, e.g. by using a loop: for $doc at $p in collection('docs') return file:write('/path/to/' || $p || '/xml', $doc) Could you forward us a little code snippet that demonstrates what you have tried so far? Thanks in advance, Christian On Mon, Mar 1, 2021 at 1:34 PM Brune, Nicole <Brune@zbmed.de> wrote:
Dear all,
please excuse me if this has been covered in the documentation and I just haven’t found it.
I am trying to harvest some information from XML files in a database (all XML files) and create several new XML files with the information. I am aware of the function write:file(path, data).
Is it possible to write several files in one go and via one XQuery? I have tried exchanging „../test.xml“ with „../test[1 to 2000].xml, …“ but, unfortunately, it did not work.
Thank you kindly in advance for your help!
Best, Nicole