Through collaborative and coordinated effort between W3C's XML Query Working Group and XSL Working Group, a collection of ten updated working draft specifications has been issued for public review and comment. XQuery 1.0 and XPath 2.0 Data Model and XQuery 1.0 and XPath 2.0 Functions and Operators are in Last Call WD status through June 30, 2003. XPath 2.0, XSLT 2.0, XQuery 1.0, and other specifications are dependent upon the data model, functions, and operators defined in these two WDs. Other working drafts include XQuery 1.0 and XPath 2.0 Formal Semantics, XML Path Language (XPath) 2.0, XSL Transformations (XSLT) Version 2.0, XQuery 1.0: An XML Query Language, XML Query Use Cases, XML Query (XQuery) Requirements, XSLT 2.0 and XQuery 1.0 Serialization, and XQuery and XPath Full-Text Requirements. The W3C XSL Working Group "develops and maintains three main specifications: XSL Transformations (XSLT) for transforming XML documents, XSL Formatting Objects (XSL/FO) for formatting XML documents, and, jointly with the XML Query Working Group, XPath 2.0 and associated documents. XPath is used to address, point into, or match portions of XML documents. Since November 2002, the XSL Working Group has been working closely with the XML Query Working Group on XPath 2, the corresponding Data Model, and on XSLT 2.0. The W3C XML Query working group was chartered "to provide flexible query facilities to extract data from real and virtual documents on the Web; the XML Query language should encompass selecting whole documents or components of documents based on specified selection criteria as well as constructing XML documents from selected components. The WG's goal is to produce a formal data model for XML documents with Namespaces (based on the XML Infoset), a set of query operators on that data model (a so-called algebra), and a query language with a concrete canonical syntax based on the proposed operators." Both working groups are part of the W3C XML Activity.
Updated XQuery, XSLT, and XPath Specifications
XQuery 1.0 and XPath 2.0 Data Model. W3C Working Draft 02-May-2003. Latest version URL: http://www.w3.org/TR/xpath-datamodel/. Edited by: Mary Fernández (XML Query WG), AT&T Labs; Ashok Malhotra (XML Query and XSL WGs), Microsoft; Jonathan Marsh (XSL WG), Microsoft; Marton Nagy (XML Query WG), Science Applications International Corporation (SAIC); Norman Walsh (XSL WG), Sun Microsystems. "This document defines the XQuery 1.0 and XPath 2.0 Data Model, which is the data model of XPath 2.0, XSLT 2.0 and XQuery 1.0: A Query Language for XML The XQuery 1.0 and XPath 2.0 Data Model (henceforth 'data model') serves two purposes. First, it defines precisely the information contained in the input to an XSLT or XQuery processor. Second, it defines all permissible values of expressions in the XSLT, XQuery, and XPath languages. A language is closed with respect to a data model if the value of every expression in a language is guaranteed to be in the data model. XSLT 2.0, XQuery 1.0, and XPath 2.0 are all closed with respect to the data model. The data model is based on the XML Information Set, but it requires the following new features to meet the XPath Requirements Version 2.0 and XML Query Requirements: (1) Support for XML Schema types. The XML Schema recommendations define features, such as structures (XMLSchema Part 1) and simple data types (XMLSchema Part 2), that extend the XML Information Set with precise type information; (2) Representation of collections of documents and of complex values. (XML Query Requirements) As with the Infoset, the XQuery 1.0 and XPath 2.0 Data Model specifies what information in the documents is accessible, but it does not specify the programming-language interfaces or bindings used to represent or access the data..."
XQuery 1.0 and XPath 2.0 Functions and Operators. W3C Working Draft 02-May-2003. Latest version URL: http://www.w3.org/TR/xpath-functions/. Edited by: Ashok Malhotra (XML Query and XSL WGs), Microsoft; Jim Melton (XML Query WG), Oracle Corp; Norman Walsh (XSL WG), Sun Microsystems. "This document defines basic operators and functions on the datatypes defined in XML Schema Part 2: Datatypes for use in XQuery, XPath, XSLT and other related XML standards. It also discusses operators and functions on nodes and node sequences as defined in the XQuery 1.0 and XPath 2.0 Data Model for use in XQuery, XPath, XSLT and other related XML standards..."
XQuery 1.0 and XPath 2.0 Formal Semantics. W3C Working Draft 02-May-2003. Latest version URL: http://www.w3.org/TR/xquery-semantics/. Edited by: Denise Draper (XML Query WG), Nimble Technology; Peter Fankhauser (XML Query WG), Infonyte GmbH; Mary Fernández (XML Query WG), AT&T Labs - Research; Ashok Malhotra (XML Query and XSL WGs), Microsoft; Kristoffer Rose (XSL WG), IBM Research; Michael Rys (XML Query WG), Microsoft; Jérôme Siméon (XML Query WG), Bell Labs, Lucent Technologies; Philip Wadler (XML Query WG), Avaya. "This document defines the formal semantics of XQuery 1.0 and XPath 2.0... This document defines the semantics of XPath/XQuery by giving a precise formal meaning to each of the expressions of the XPath/XQuery specification in terms of the XPath/XQuery data model. This document assumes that the reader is already familiar with the XPath/XQuery language. Two important design aspects of XPath/XQuery are that it is functional and that it is typed. These two aspects play an important role in the XPath/XQuery Formal Semantics. XPath/XQuery is a functional language. XPath/XQuery is built from expressions, rather than statements. Every construct in the language (except for the XQuery query prolog) is an expression and expressions can be composed arbitrarily. The result of one expression can be used as the input to any other expression, as long as the type of the result of the former expression is compatible with the input type of the latter expression with which it is composed. Another aspect of the functional approach is that variables are always passed by value and their value cannot be modified through side-effects. XPath/XQuery is a typed language. Types can be imported from one or more XML Schemas that describe the input documents and the output document, and the XPath/XQuery language can then perform operations based on these types. In addition, XPath/XQuery supports static type analysis. This means a static analysis phase is defined on XPath/XQuery expressions that infers the output type of an expression, based on the type of its inputs. Static typing allows early detection of type errors, and can be used as the basis for certain forms of optimization. The XPath/XQuery type system captures most of the features of XML Schema Part 1, including global and local element and attribute declarations, complex and simple type definitions, named and anonymous types, derivation by restriction, extension, list and union, substitution groups, and wildcard types. It does not model uniqueness constraints and facet constraints on simple types..."
XML Path Language (XPath) 2.0. W3C Working Draft 02-May-2003. Latest version URL: http://www.w3.org/TR/xpath20/. Edited by: Anders Berglund (XSL WG), IBM Research; Scott Boag (XSL WG), IBM Research; Don Chamberlin (XML Query WG), IBM Almaden Research Center; Mary F. Fernández (XML Query WG), AT&T Labs; Michael Kay (XSL WG), Software AG; Jonathan Robie (XML Query WG), DataDirect Technologies; Jérôme Siméon (XML Query WG), Bell Labs, Lucent Technologies. "XPath is a language for addressing parts of an XML document... This version contains a new syntax for identifying types, and new features that allow path expressions to select element and attribute nodes based on their types as well as their names. It changes some of the details of the semantics of arithmetic and comparison operators, including making the value comparison operators transitive. It includes some grammar changes, including changes in the comment delimiters and the syntax of the cast expression... The primary purpose of XPath is to address parts of an XML document. XPath uses a compact, non-XML syntax to facilitate use of XPath within URIs and XML attribute values. XPath operates on the abstract, logical structure of an XML document, rather than its surface syntax. This logical structure is known as the data model, and is described in the XQuery 1.0 and XPath 2.0 Data Model document. XPath gets its name from its use of a path notation as in URLs for navigating through the hierarchical structure of an XML document. XPath is designed to be embedded in a host language such as XSLT 2.0 or XQuery. XPath has a natural subset that can be used for matching (testing whether or not a node matches a pattern)... XQuery Version 1.0 is an extension of XPath Version 2.0. Any expression that is syntactically valid and executes successfully in both XPath 2.0 and XQuery 1.0 will return the same result in both languages. Since these languages are so closely related, their grammars and language descriptions are generated from a common source to ensure consistency, and the editors of these specifications work together closely."
XSL Transformations (XSLT) Version 2.0. W3C Working Draft 02-May-2003. Latest version URL: http://www.w3.org/TR/xslt20/. Edited by Michael Kay (Software AG). "This specification defines the syntax and semantics of XSLT 2.0, which is a language for transforming XML documents into other XML documents. XSLT 2.0 is designed to be used in conjunction with XPath 2.0... XSLT shares the same data model as XPath 2.0, which is defined in Data Model, and it uses the library of functions and operators defined in Functions and Operators. XSLT 2.0 also includes optional facilities to serialize the results of a transformation, by means of an interface to the serialization component described in XSLT and XQuery Serialization... A transformation expressed in XSLT describes rules for transforming one or more source trees into one or more result trees. The transformation is achieved by a set of template rules. A template rule associates a pattern, which matches nodes in the source document, with a sequence constructor, which can be evaluated to produce part of a result tree. The structure of the result trees can be completely different from the structure of the source trees. In constructing a result tree, nodes from the source trees can be filtered and reordered, and arbitrary structure can be added. This mechanism allows a stylesheet to be applicable to a wide class of documents that have similar source tree structures..."
XQuery 1.0: An XML Query Language. W3C Working Draft 02-May-2003. Latest version URL: http://www.w3.org/TR/xquery/. Edited by: Scott Boag (XSL WG), IBM Research; Don Chamberlin (XML Query WG), IBM Almaden Research Center; Mary F. Fernández (XML Query WG), AT&T Labs; Daniela Florescu (XML Query WG), BEA Systems; Jonathan Robie (XML Query WG), DataDirect Technologies; Jérôme Siméon (XML Query WG), Bell Labs, Lucent Technologies. "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... Much of this document is the result of joint work by the XML Query and XSL Working Groups, which are jointly responsible for XPath 2.0, a language derived from both XPath 1.0 and XQuery. The XPath 2.0 and XQuery 1.0 Working Drafts are generated from a common source. These languages are closely related, sharing much of the same expression syntax and semantics, and much of the text found in the two Working Drafts is identical... This version contains a new syntax for identifying types, and new features that allow path expressions to select element and attribute nodes based on their types as well as their names. It introduces the concept of a "module," and permits one module to import a function library defined in another module. It introduces changes to the semantics of element constructors, including automatic validation of the constructed element. It changes some of the details of the semantics of arithmetic and comparison operators, including making the value comparison operators transitive. It introduces a syntax by which an implementation can add its own extensions to XQuery. It includes some grammar changes, including changes in the comment delimiters and the syntax of the cast expression.
XML Query Use Cases. W3C Working Draft 02-May-2003. Latest version URL: http://www.w3.org/TR/xquery-use-cases/. Edited by: Don Chamberlin, IBM Almaden Research Center; Peter Fankhauser, Infonyte GmbH; Daniela Florescu, BEA; Massimo Marchiori, W3C/MIT/UNIVE; Jonathan Robie, DataDirect Technologies. "The use cases listed [in this document] were created by the XML Query Working Group to illustrate important applications for an XML query language. Each use case is focused on a specific application area, and contains a Document Type Definition (DTD) and example input data. Each use case specifies a set of queries that might be applied to the input data, and the expected results for each query. Since the English description of each query is concise, the expected results form an important part of the definition of each query, specifying the expected output format..."
XML Query (XQuery) Requirements. W3C Working Draft 02-May-2003. Latest version URL: http://www.w3.org/TR/xquery-requirements. Edited by: Don Chamberlin, IBM Almaden Research Center; Peter Fankhauser, Infonyte GmbH; Massimo Marchiori, W3C/MIT/University of Venice; Jonathan Robie, DataDirect. "This document specifies goals, requirements, and usage scenarios for the W3C XML Query (XQuery) data model, algebra, and query language. It also includes, for each requirement, a corresponding status, indicating the current situation of the requirement in the XML Query family of specifications..."
XSLT 2.0 and XQuery 1.0 Serialization. W3C Working Draft 02-May-2003. Latest version URL: http://www.w3.org/TR/xslt-xquery-serialization/. Edited by Michael Kay (Software AG) and Norman Walsh (Sun Microsystems). "This document defines serialization of the W3C XQuery 1.0 and XPath 2.0 Data Model, which is the data model of at least XPath 2.0, XSLT 2.0, and XQuery 1.0, and any other specifications that reference it... Serialization is the process of converting an instance of the Data Model into a sequence of octets. Serialization is well-defined for most data model instances..."
XQuery and XPath Full-Text Requirements. W3C Working Draft 02-May-2003. Latest version URL: http://www.w3.org/TR/xquery-full-text-requirements/. Edited by Stephen Buxton (Oracle Corp) and Michael Rys (Microsoft). "'Full-Text Search' (FTS) is a large field which covers a vast array of functionality. In addition, there are many different ways one could combine FTS capabilities with XQuery and XPath. This paper describes a set of requirements for FTS in XQuery/XPath (XQuery/XPath Full-Text). At this stage in the life of the document, these requirements should be read as suggestions only: the issues associated with the requirements are to be discussed and resolved by the relevant Working Groups. This format provides a firm basis for the Working Groups to set the direction of the work on XQuery/XPath Full-Text, and to compare existing proposals. Once the issues are resolved and this Requirements document is finalized, it will be easier to define the functionality of XQuery/XPath Full-Text and it's integration with XQuery and/or XPath. Note that we will attempt to define requirements for the language without reference to any particular solution..."
Overview of the May 02, 2003 Working Draft Releases
"The Data Model and Functions and Operators are Last Call drafts. If you can only read two drafts, read those. And send in your comments. I encourage you to use a 'one email message per comment' style, but the important thing is that you send in your comments. XPath 2.0 is common to both XSLT 2.0 and XML Query 1.0. So the XPath 2.0 draft belongs on your reading list. After that, you may want to read either the XSLT 2.0 draft or the XQuery draft or both depending on your interest. The Serialization document is mostly the old serialization section from previous XSLT 2.0 drafts, so it's not radically new material. It's been factored out so that XSLT and XQuery can more easily share it. Formal Semantics describes formally how these languages work. The requirements describe what the WGs are trying to accomplish (and what they're not trying to accomplish). The use cases show you how the current languages work..." [posted to XML-DEV by Norm Walsh, Sun Microsystems, Inc.]
Comments from Jonathan Robie
"XQuery Marks the Spot." By Jack Vaughan. In Application Development Trends (May 05, 2003). Excerpt:
"XML has emerged in only five years as a startlingly powerful means of handling data. It has also been accompanied by a slew of "X-centric" helper tools, APIs and standards such as XSLT, XPath and, of late, XQuery.
Generally, XML must exist within the context of other software system languages, and so Java developers, .NET developers, Cobol developers, SQL developers and others have had to learn something about this markup language that grew out of SGML, a relatively obscure document-related language. With more developers encountering XML all the time, some will soon look at XQuery as an option for system building.
According to the W3C group that is working to specify XQuery, the markup language will build on the idea that a query language using the structure of XML intelligently can express queries across all kinds of data. To cast some light on this technology, we spoke recently with Jonathan Robie, XML program manager at DataDirect Technologies as well as a member of the W3C's XML Query Working Group that is at work on XQuery. Robie is an editor of the XQuery specification and several related specifications.
"In many development environments, people have to work with relational data, XML and data found in objects. These have three very different data models -- three very different ways of representing and manipulating data," said Robie. "For XML and relational data, XQuery allows you to work in one common model, an XML-based model that can also be used with XML views of relational data." [...]
"Native XML programming is at the heart of XQuery. XML is not object oriented, nor is it relational. XQuery is portable, type safe and can be optimized for database access. It is ideal for queries that must represent results as XML, to query XML stored inside or outside the database, or to span relational and XML sources," said Robie.
"If you're in the XML world and you want to integrate data sources, XQuery is the way to do it. If you are in a SQL world and XML is just one more type of data, then SQL/XML is good for that," he noted.
"XQuery is XML-centric. SQL/XML is SQL-centric. People who want to think in XML will use XQuery, while people who want to think in SQL will use SQL/XML," Robie said.
Speaking to W3C group efforts, Robie said, "we leaned heavily on the design of existing languages, including SQL, XPath and XQL, XML-QL and OQL, but we combined them in new ways and needed to innovate because of the structure of XML." [...]
- References for the ten updated Working Drafts are supplied above.
- W3C XML Query Working Group website
- W3C XSL Working Group website
- XML Query Mailing lists
- firstname.lastname@example.org. Mailing list for query languages, including (but not limited to) discussion on the XML-Query project.
- email@example.com. Public mailing list is used to submit comments on the publications of the XML Query and XSL working groups.
- W3C's Grammar Test Pages
- The XQuery 1.0 Grammar Test Page. "A tool for readers and parser implementers of XQuery 1.0. It allows them to type in an expression, and then view the parse tree, or else obtain an error if it is syntactically incorrect. The results should not be used as an absolute reference, and may flag legal syntax or errors not intended by the drafts..." Views: View XQuery BNF, View XQuery JJDOC BNF, View XQuery Use Cases specification.
- The XPath 2.0 Grammar Test Page. Views: View xpath BNF, View xpath JJDOC BNF.
- "XML and Query Languages" - Main reference page.
- "Extensible Stylesheet Language (XSL/XSLT)" - Main reference page.