XQuery

The W3C describes the mission of the XML Query project as follows: "The mission of the XML Query project is to provide flexible query facilities to extract data from real and virtual documents on the World Wide Web, therefore finally providing the needed interaction between the Web world and the database world. Ultimately, collections of XML files will be accessed like databases."

XQuery was originally conceived as a query language for large collections of XML documents, but it is equally capable of transforming individual documents. Syntactically, XQuery shares some similarities with SQL.

XQuery is a functional language. Its file names conventionally use the extension .xq, .xql, or .xquery.

Some characters cannot be used literally inside XQuery string literals or constructed content and must be written using a numeric character reference:
CharacterEscape
(new line)

(space) 
(tab)	
{{
}}
&&
'"

Numeric character references commonly used to escape special characters in XQuery string literals.

This chapter covers the following topics: