W3C

XQuery 4.0: An XML Query Language

W3C Editor's Draft 14 December 2022

This version:
https://qt4cg.org/specifications/xquery-40/
Most recent version of XQuery:
https://qt4cg.org/specifications/xquery-40/
Most recent Recommendation of XQuery:
https://www.w3.org/TR/2017/REC-xquery-31-20170321/
Editor:
Michael Kay, Saxonica <mike@saxonica.com>

Please check the errata for any errors or issues reported since publication.

See also translations.


Abstract

XML is a versatile markup language, capable of labeling the information content of diverse data sources including structured and semi-structured documents, relational databases, and object repositories. A query language that uses the structure of XML intelligently can express queries across all these kinds of data, whether physically stored in XML or viewed as XML via middleware. This specification describes a query language called XQuery, which is designed to be broadly applicable across many types of XML data sources.

JSON is a lightweight data-interchange format that is widely used to exchange data on the web and to store data in databases. Many applications use JSON together with XML and HTML. XQuery 4.0 extends XQuery to support JSON as well as XML, adding maps and arrays to the data model and supporting them with new expressions in the language and new functions in [XQuery and XPath Functions and Operators 4.0]. A list of changes made since XQuery 3.1 can be found in K Change Log. These are the most important new features in XQuery 4.0:

  1. 4.14.1 Maps.

  2. 4.14.2 Arrays.

Status of this Document

This is a first proposal by the editor, with no official standing whatsoever. Comments are invited.