Dear Bryan,
we are currently including new db:create() and db:drop() functions to BaseX. Until then, there are other options to do what you want. One example is creating a command script from XQuery [1] and run it afterwards, e.g. as follows:
file:write('script.bxs', <commands>{ for $c in distinct-values(db:open('your-db')/*/name()) return <create-db name="{ $c }"/> }</commands>)
In the next step, you could add the documents to the newly created databases:
for $doc in db:open('Analysedocumentaire') let $name := $doc/*/name() return db:add($name, $doc)
Hope this helps, Christian
[1] http://docs.basex.org/wiki/Commands#Basics ___________________________
On Thu, Oct 25, 2012 at 2:19 PM, bryan rasmussen rasmussen.bryan@gmail.com wrote:
Hi,
I have a db that has all of my xml documents, I would like to make a bunch of new dbs based on the document types which map to the document element name so for example if I do the query /LOV I get back 115491 Items, I would then like to put that into a db named LOV. How do I put the outputs of query on one db into another db, and does anyone have some code that would go through every /* and create a db by the name of the document element if that db does not exist and then place the document into that DB - or would that be insanely process intensive (there are 290422 items, 13 document types)?
Thanks, Bryan Rasmussen _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk