XQuery is is query and functional programming language designed to query XML data like SQL from database. XQuery version 1.0 was developed by a group within W3C [http://en.wikipedia.org/wiki/W3C]
Using XQuery, we can read/write/update data to/from XML documents or any data source that can be viewed as XML. XPath is closely related to XQuery as this is used in XQuery expressions to retreive specific parts of XML.
XQuery is based on the XQuery and XPath Data Model (XDM) which uses a tree-structured model which is composed of various parts as depicted in the below picture.
The XML declaration and encoding where you declare the XML version and encoding
- The xml document contains Root Element, Child elements and attributes.
- root element for any XML. You don’t have to go with “root” as name. Your name is also ok in XML as XML is very open.
- Any level of nested sub elements is possible. In the picture, I have showed 3 levels only.
- attributes can be tagged to any element of XML structure.
Below are some areas where XQuery is heavily used:
- XML Parsing
- XML Transformation
- System Integration
- Many COTS products – (ex. OSM as a core programming and customization language)
This is very basic introduction for XQuery and XML for setting the context. More details about XML and XQuery can be found at “http://en.wikipedia.org/wiki/XQuery” and “http://www.w3schools.com/xquery/default.asp”.