XML Query

The W3C has released the XQuery specification (http://www.w3.org/XML/query ), which promises to enable the querying of XML documents in the same way that you can query a SQL database. Here's an example of XQuery syntax applicable to our review document:

document("review1.xml")/BODY/REVIEW

This XQuery statement returns all the reviews referred to in the body of the XML document review1.xml.

The syntax of the XQuery language is built around the XPath representation of XML data structures. The XQuery language also provides for complex instructions within queries. For instance, you process through a corpus of XML documents, returning the titles and abstracts only for those that meet a certain set of criteria. This functionality mirrors that of SQL in many ways. In fact, not satisfied with simply querying within XML documents, the XQuery folks are also attacking the problem of how to query SQL databases using XQuery. This might seem like reinventing the wheel, but the thrust of the argument is this: Why have one query language for relational databases and another query language for XML documents when you can have a single query language that does both? Using one language simplifies development, architecture, and the modeling of data.

The usual cast of characters (Microsoft, Oracle, Sun, and so forth) are in the working group, so there's every chance XQuery will be adopted by many vendors of XML and relational tools and applications. However, as of this writing, it hasn't yet been adopted.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.163.58