What a great question and answer.
Additional question: what is relation between the only document in the database, and collection of documents, stored in that database.
Is it like this?: *database contains one document, this document is/defines collection of documents.*
Am I correct?
Jan Vlčinský
On 8 November 2011 10:07, Michael Seiferle <michael.seiferle@uni-konstanz.de
wrote:
Hi Edward,
thanks for you email. Am 08.11.2011 um 05:40 schrieb Edward Fong:
Hi, What's the diff between Database and collection? I think there are same in baseX, am I right?
close, a database contains one document node, while a collection is allowed to contain several document nodes. You can easily create a collection by creating a database from a source directory, by running the following command. CREATE db collection-test /path/to/xml-directory
To query individual file inside that collection you can use the following:
for $doc in *collection*('*test*/input.xml') return base-uri($doc)
To query each file inside your collection run the following: for $doc in *collection*('*test*') return base-uri($doc)
Where '*test*' is the name of the collection and '/input.xml' is the path to the document inside this collection.
I hope this helps, feel free to ask for more information as needed.
Kind regards Michael
And how to query by a document name? Following are steps of my testing: 1: loaded some xml files form a directory: d:\data\org-*.xml 2: query by doc('org-100525.xml') and got File or directory "D:/Program Files (x86)/BaseX701/bin/org-100525.xml" not found message. 3: because after loaded xml, directory: d:\data\org-*.xml was removed. I can't query by doc('d:\data\org-100525.xml')
Thanks, Edward
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk