From: Wolfgang M. <wol...@gm...> - 2006-07-29 18:44:42
|
> How can I simply do with xquery, what can be done easily with ant when > storing documents with the createsubcollections parameter of xdbstore? > So I want to store a directory structure, and I want to keep that > structure in the collection too. With ants xdbstore it's easy, but in > xquery, xmldb:store-files-from-pattern() doesn't have a parameter like > createsubcollections. Is there any solutions? 1) create a function in XQuery that takes a path, splits it into its components and checks for every sub-path if the corresponding collection exists or not. Create the needed collections with xmldb:create-collection. 2) extend xmldb:store-files-from-pattern or xmldb:store to do what you want. It should not be difficult to adopt the code from the Ant task. See XMLDBStoreTask.mkcol. If you choose 2), please send us a patch :-) Wolfgang |