If there's to better way you should be able to simply copy the docs without first exporting them:
For $dbname in $dbNames Return Let $docs := collection($dbname) For $doc in $docs db:add($newDbName, $doc, $local:makeNewDocUrl($doc)) Or something close to that Cheers, Eliot ---- Eliot Kimber, Owner Contrext, LLC http://contrext.com On 7/24/15, 2:30 PM, "Amanda Galtman" <basex-talk-boun...@mailman.uni-konstanz.de on behalf of amanda.galt...@mathworks.com> wrote: >Hi, > >Is there a simple, fast way to merge databases? For example, suppose I >have 200 databases, each with 5 XML documents, and the document paths are >unique across all the databases. I want to produce a database containing >all 1000 documents. > >I looked in the Database Module wiki and nothing jumped out as being >uniquely tailored for this task. I¹m sure there is an ad hoc way to do it >by looping over the documents in the databases, exporting them, and >adding them to the new database. > But if that takes the same amount of time as building the 200 databases >in the first place, I should change other things about my design to avoid >the need to merge databases. > >Thanks, >Amanda >