I did some work and try to avoid using the RDBMS part. So here is my question again
If I have 100 XML files with structure as :
<bookstore> <book> <title>Learn XML</title> <author>ABC</author> </book> <book> <title>Learn Java</title> <author>PQR</author> </book> ------- ------- { more such book elements} </bookstore>
So if I want to directly write query like " All books authored by "ABC" sorted by name of book" on the collection of 100 XML files. Is there anyway of doing this with Xquery/Xpath. Can someone provide me steps and a query for doing that.
Also one more question as BaseX is a database for XML but I am not actually able to figure out its real advantages over databases available. Is its interface or functionality or anything else which is better than other databases.
Thank you in advance and hope to hear from you soon.
-- Ankur
On Mon, Jan 21, 2013 at 4:43 AM, Christian Grün christian.gruen@gmail.comwrote:
I have 10 of these files in my collection. So my question is how can I
query
all these Xml files at ones and get specific results like "Books with
price
value greater than 100".
Use a simple XPath expression [1], such as
collection("name-of-collection"//Books[Price > 100]
You mentioned our REST service, which can also be used for that [2]:
http://localhost:8984/rest/name-of-collection?query=//Books...
Once I get these results I want to store the result in a RDBMS so that at later point I can query that RDBMS to generate
certain
reports.
Check out the SQL Module of our documentation [3] and give it a try.
Regards, Christian
[1] http://www.w3schools.com/xpath/ [2] http://docs.basex.org/wiki/REST [3] http://docs.basex.org/wiki/SQL