XQuerry Help on Collections

Tuesday, 29 November 2016 · 2 messages
MM
Mike Maul29 Nov 2016 07:24 #

I'm struggling a bit with XQuery especially in terms of collections. How would one take q query like for $x in doc('src/main/resources/xml/input.xml')//li return data($x) and apply it to a database with a collection of documents? What I'm after is something like: for $x in doc(*)//li return data($x) Also how are namespaces referenced/specified in queries?

Finally if anyone as any good XQuery resources would appreciate if if you could pass them along...

MG
Maximilian Gärber29 Nov 2016 09:42 #

Hi Mike,

see here: http://docs.basex.org/wiki/Databases#XML_Documents

For an overwiew what's available: http://docs.basex.org/wiki/Modules

I mostly refer to the BaseX documentation (which is really good).

You might also have a look at: https://en.wikibooks.org/wiki/XQuery

e.g. https://en.wikibooks.org/wiki/XQuery/Updates_and_Namespaces

Regards, Max

2016-11-29 6:23 GMT+01:00 Mike Maul <mike.maul at gmail.com>:

Quoted text · Mike Maul · 10 lines
> I'm struggling a bit with XQuery especially in terms of collections. > How would one take q query like > for $x in doc('src/main/resources/xml/input.xml')//li return data($x) > and apply it to a database with a collection of documents? What I'm after is > something like: > for $x in doc(*)//li return data($x) > Also how are namespaces referenced/specified in queries? > > Finally if anyone as any good XQuery resources would appreciate if if you > could pass them along...

⚡Generated with XQuery