What is XML Query Language (XQuery)?
XML Query Language (XQuery) is a query and programming language for processing XML documents and data. XML data and other databases that store data in a format similar to HTML can be processed with XQuery. The main goal of XQuery is to provide query mechanisms for data extraction from real and virtual web-based documents. The aim is to link web and database technologies with the help of XML.
The World Wide Web Consortium is responsible for framing XQuery 1.0.
XQuery behaves like an expression language in that it specifies the exact flow of data and operations to achieve a desired result. There is no mention of how the data is mapped to a particular programming platform in terms of syntax. For example, an expression specifies the result value of an addition, but does not deal with the declaration of variables, the data types used and commands or function calls.
XML documents can be created using the syntax provided with XQuery. The XML documents are processed to extract structural information classified as document nodes, elements, attributes, text nodes, comments, processing instructions, and namespaces.
All data elements or values are treated as sequences by default. Atomic values, or nodes, are the type of data elements that exist in an XML document. The atomic values such as Boolean, Integer and String correspond to the XML schema specification. Features such as full-text based searches and document updates are currently being developed.