What is XQuery?
XQuery, while still in final draft stage, is the much awaited query language for XML. XQuery provides XML with somewhat equivalent functionality of what SQL provides to relational databases. It offers a convenient, efficient, and straightforward method to extract information from one or multiple xml documents. This information may be filtered using arbitrary criteria and represented in any format chosen by the user.
XQuery is a declarative language. It considers the versatility of XML and is therefore flexible enough to be used for either document or data oriented XML. It is a strongly typed language that supports namespaces and XML Schema datatypes. XQuery offers two different syntaxes, one that is in XML format, and one that is easily read and written by people.
Learning XQuery
XQuery has been in draft stage for many years and a good number of websites and articles have not been updated as XQuery continued evolving. As you research XQuery information online, you will have to assess the timeliness and accuracy of the information. The most accurate source of information is always the W3C documentation, but lengthy technical documents are not for everyone, and a tutorial is probably the best place for most people to start.
This site will soon contain an updated XQuery tutorial. In the meantime, you may want to take a look at the ones listed below. Be aware that XQuery relies heavily on XPath (XQuery is actually a superset of XPath), so understanding at least the basics of XPath is essential to achieving anything useful with XQuery. Most tutorials I've seen assume the reader has little or no XPath experience.
Sorting Through the W3C Recommendations
- XML Query Requirements
- XML Query Use Cases
- XQuery 1.0 and XPath 2.0 Data Model
- XSLT 2.0 and XQuery 1.0 Serialization
- XQuery 1.0 and XPath 2.0 Formal Semantics
- XQuery 1.0: An XML Query Language
- XML Syntax for XQuery 1.0 (XQueryX)
- XQuery 1.0 and XPath 2.0 Functions and Operators
- XPath Requirements Version 2.0
- XML Path Language (XPath) 2.0
- XML Query and XPath Full-Text Requirements
- XML Query and XPath Full-Text Use Cases
- XQuery 1.0 and XPath 2.0 Full-Text
- XQuery Update Facility Requirements
- XQuery Update Facility
- XQuery Update Facility Use Cases
- Building a Tokenizer for XPath or XQuery
Best viewed with Firefox