XQuery
XQuery is to XML what SQL is to database tables.
XQuery is designed to query XML data - not just XML files, but anything that can appear
as XML, including databases.
What is XQuery?
XQuery is the language for querying XML data
XQuery for XML is like SQL for databases
XQuery is built on XPath expressions
XQuery is supported by all major databases
XQuery is a W3C Recommendation
XQuery is a language for finding and extracting elements and attributes from XML
documents.
XQuery 1.0 and XPath 2.0 share the same data model and support the same functions
and operators. If you have already studied XPath you will have no problems with
understanding XQuery.
Mmcc Computer Centre, 38 Burkit Road, T.Nagar, Chennai-17
24323605, 9444037410 47754161.docx Page 1 of 2
XQuery concepts
A query in XQuery is an expression that:
•reads a sequence of XML fragments or atomic values
•returns a sequence of XML fragments or atomic values
The principal forms of XQuery expressions are:
•path expressions
•element constructors
•FLWOR ("flower") expressions
•list expressions
•conditional expressions
•quantified expressions
•datatype expressions
Expressions are evaluated relative to a context:
•namespaces
•variables
•functions
•date and time
•context item (current node or atomic value)
•context position (in the sequence being processed)
•context size (of the sequence being processed)
Mmcc Computer Centre, 38 Burkit Road, T.Nagar, Chennai-17
24323605, 9444037410 47754161.docx Page 2 of 2