Copyright © 2003 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply.
This document describes the requirements for the XPath 2.0 specification and is annotated with their resolution in [XPath 2.0] or [XQuery 1.0 and XPath 2.0 Functions and Operators] and the [XQuery 1.0 and XPath 2.0 Data Model] specifications.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.
This document is the first revision of the [XPath 2.0 Requirements] working draft. This revision includes, for each requirement, a corresponding status, indicating the current situation of the requirement in the XPath 2.0 family of specifications. A future revision will be provided when all remaining open issues have been resolved and when the XPath 2.0 documents are issued as Last Call working drafts.
This is a W3C Working Draft for review by W3C Members and other interested parties. Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This document has been defined jointly by the XSL Working Group and the XML Query Working Group (both part of the XML Activity).
The XSL Working Group and XML Query Working Group have consensus except in a few specific areas as noted below and the details of these areas are still under active discussion. Nonetheless, we are publishing this draft to encourage early public feedback to the XPath 2.0 requirements process.
Comments on this document should be sent to the W3C mailing list public-qt-comments@w3.org (archived at http://lists.w3.org/Archives/Public/public-qt-comments/).
Patent disclosures relevant to this specification may be found on the XSL Working Group's patent disclosure page at http://www.w3.org/Style/XSL/Disclosures.html and the XML Query Working Group's patent disclosure page at http://www.w3.org/2002/08/xmlquery-IPR-statements.
A list of current W3C Recommendations and other technical documents can be found at http://www.w3.org/TR/.
XPath 2.0 has the following goals:
1 |
Must Support the XML "Family"
of Standards As part of the evolving family of XML standards, XPath 2.0 MUST support the W3C XML architecture by integrating well with other standards in the family. |
||||
1.1 |
Must Express Data model in
Terms of the Infoset XPath 2.0 data model MUST be expressed in terms of the XML Infoset, including Post Schema Validation Infoset contributions. Ideally, XSLT, XPath, and XML Query should share a common data model. Satisfied by the Notation section in [XQuery 1.0 and XPath 2.0 Data Model]. |
||||
1.2 |
Must Provide Common Core
Syntax and Semantics for XSLT 2.0 and XML Query
1.0 XSLT 2.0 contains an expression language which is "XPath 2.0 plus XSLT 2.0 extensions". XML Query 1.0 contains an expression language which we believe should be "XPath 2.0 plus XML Query 1.0 extensions." The scope of XPath 2.0 must be the set of common functionality between the expression language of XSLT 2.0 and the expression language of XML Query 1.0. This will guarantee for Web developers and users that any common functionality are implemented with identical syntax and semantics.
Satisfied by Introduction in [XPath 2.0]. |
||||
1.3 |
Must Support Explicit "For
Any" or "For All" Comparison and Equality
Semantics It MUST be possible for boolean expressions involving node-sets to explicitly use "for any" or "for all" semantics, otherwise known as explicit existential quantification and explicit universal quantification, respectively. Any implicit quantification should be explained in terms of these explicit semantics. Satisfied by section 3.9 Quantified Expressions in [XPath 2.0].
|
||||
1.4 |
Must Extend Set of
Aggregation Functions XPath 1.0 currently supports Satisfied by section 15.3.3 fn:min() and 15.3.4 fn:max() in [XQuery 1.0 and XPath 2.0 Functions and Operators]. |
||||
1.5 |
Should Maintain Backwards
Compatibility with XPath 1.0 Any valid XPath 1.0 expression SHOULD also be a valid XPath 2.0 expression, and have the same semantics when operating in the absence of XML Schema type information. If not possible to achieve due to other requirements, XPath 2.0 should minimize the number of changes to the XPath 2.0 syntax to maximize backward compatibility with XPath 1.0. Satisfied by Appendix F in [XPath 2.0]. |
||||
1.6 |
Should Provide Intersection
and Difference Functions XPath 1.0 supports the union of two node sets. Set functionality in XPath 2.0 SHOULD be expanded to include intersection and difference functions, and should be compatible with equivalent functions supported by XML Query. Satisfied by union, intersect, and except in section 3.3.2 Combining Sequences in [XPath 2.0].
|
||||
1.7 |
Should Support Unary Plus
Operator XML Schema allows decimals to have a leading plus. To align better with this, XPath 2.0 SHOULD allow this by providing a unary plus operator.
Satisfied by section 6.2.7 op:numeric-unary-plus in [XQuery 1.0 and XPath 2.0 Functions and Operators]. |
||||
2 |
Must Improve Ease of
Use Users of XPath 1.0 have requested enhancements to simplify expression of common XPath use cases. XPath 2.0 MUST address these frequently requested enhancements. |
||||
2.1 |
Must Loosen Restrictions on
Location Steps To better align with XPointer
and to simplify the use of XPath expressions in which
multiple alternatives are allowed for a given location
step, XPath 2.0 MUST relax current restrictions for what
can appear after a ' Satisfied by section 3.2.1 Steps which allow union and node-set functions in [XPath 2.0].
|
||||
2.2 |
Must Provide a Conditional
Expression Many users have requested the ability to return a conditional value based on a boolean expression. XPath 2.0 MUST provide a conditional expression which takes three expressions:
and evaluates to expression2 if
expression1 is Satisfied by section 3.8 Conditional Expressions in [XPath 2.0].
|
||||
2.3 |
Must Define Consistent
Implicit Semantics for Collection-Valued
Subexpressions In XPath 1.0, the use of a collection-valued subexpression can introduce an implicit existential quantification or choose-first-member operation into the containing expression's semantics. XPath 2.0 MUST define a consistent implicit semantics for expressions that have collection-valued subexpressions. This may require that XPath 2.0 expressions use explicit quantification or indexing expressions to achieve the same implicit semantics provided in XPath 1.0. Satisfied by inclusion of implicit existensial quantification in 3.5.2 General Comparisons in [XPath 2.0]. Note that it is not included in Value Comparisons. The first member semantics were dropped except for Backwards Compatibility mode.
|
||||
2.4 |
Should Support Additional
String Functions Users of XSLT 1.0 have requested additional string manipulation functions. Common requests include string padding (with spaces, dashes, or other characters), string replacement, and converting strings to upper and lower case. XPath 2.0 SHOULD provide additional string functions. As with any string functions, internationalization issues need to be addressed to insure that the functionality is as broadly useful as possible. |
||||
2.4.1 |
Should Simplify String
Replacement XPath 1.0 provides the Satisfied by section 7.5.3 fn:replace in [XQuery 1.0 and XPath 2.0 Functions and Operators].
|
||||
2.4.2 |
Should Simplify String
Padding Often string values need to be padded on the left or right to make the value occupy a fixed length. XPath 2.0 SHOULD support a string padding function that permits any character as a padding character. Satisfied by section 7.4.15 fn:string-pad in [XQuery 1.0 and XPath 2.0 Functions and Operators].
|
||||
2.4.3 |
Should Simplify String Case
Conversions XPath 2.0 SHOULD provide the ability to convert the case of text to upper or lower case for presentation and/or comparison. Satisfied by section 7.4.12 fn:upper-case and 7.4.13 fn:lower-case in [XQuery 1.0 and XPath 2.0 Functions and Operators]. |
||||
2.5 |
Should Support Aggregation
Functions Over Collection-Valued Expressions Users of XPath 1.0 frequently request the ability to
apply an aggregate function, like Satisfied by For Expressions in [XPath2.0].
|
||||
3 |
Must Support String Matching
Using Regular Expressions Regular expressions provide a powerful way to specify string pattern matching and now play an important role in XML Schema as the mechanism by which pattern facets are specified. XPath 2.0 MUST support regular expressions for matching against strings using the regular expression notation established in XML Schema: Datatypes. Satisfied by section 7.5.1 Regular Expression Syntax in [XQuery 1.0 and XPath 2.0 Functions and Operators].
|
||||
4 |
Must Add Support for XML
Schema Primitive Datatypes [XML Schema: Datatypes]
defines a set of primitive datatypes. In addition to the
types supported by the XPath 1.0 data model,
|
||||
4.1 |
Must Define the Operator
Matrix and Conversions XPath 2.0 MUST support the operators and type-coercion rules defined by the joint XSLT/Schema/Query task force on operators. Satisfied by sections
in [XQuery 1.0 and XPath 2.0 Functions and Operators].
|
||||
4.2 |
Must Allow Scientific
Notation for Numbers XML Schema specifies a lexical representation for
doubles and floats that includes scientific notation as
well as Satisfied by section 17.8 Casting to numeric types in [XQuery 1.0 and XPath 2.0 Functions and Operators]. |
||||
4.3 |
Must Define Appropriate Cast
and Constructor Functions XPath 2.0 MUST define an appropriate set of functions to allow users to cast and construct instances of XML Schema primitive types. At a minimum, this set MUST include cast and constructor functions for URI and date/time types. Satisfied by section 17 Casting in [XQuery 1.0 and XPath 2.0 Functions and Operators].
|
||||
4.4 |
Should Add List Data Type
to the Type System of the Expression
Langauge XML Schema allows the definition of simple types derived by list, including lists of unions of non-list simple types. XPath 2.0 SHOULD support an ordered list of simple-typed values. Satisfied by sction 5 Atomic Values of the [XQuery 1.0 and XPath 2.0 Data Model].
|
||||
4.5 |
Must Support Accessing
Simple-Typed Value of Elements and
Attributes The XPath 1.0 type system supports the
Satisfied by ElementTest and AttributeTest in [XPath 2.0]. |
||||
4.6 |
Must Define Behavior of
Operators for Null Arguments Since the typed value of an element can be
Satisfied by the Empty Sequence supported through the language including section 3.3 Sequence Expresions in [XPath 2.0].
|
||||
5 |
Should Add Support for XML
Schema: Structures XML Schema: Structures enables users to define structured types and associate them to elements in a schema. XPath 2.0 SHOULD provide support for the common operations needed for navigation and selection of typed elements. |
||||
5.1 |
Should Select
Elements/Attributes Based on an Explicit XML Schema
Type XML Schema : Structures provides the ability to define the type of an element or attribute. XPath 2.0 SHOULD be able to test whether an element or attribute is an instance of a given type. Satisfied by SequenceType Matching in [XPath 2.0].
|
||||
5.2 |
Should Select
Elements/Attributes Based on XML Schema Type
Hierarchy XML Schema : Structures provides the ability to define a hierarchy of types by derivation. XPath 2.0 SHOULD be able to selects elements or attributes that are instances of a type, also matching any types derived from it by restriction or extension.
Satisfied by SequenceType Matching in [XPath 2.0].
|
||||
5.3 |
Should Select Elements
Based on XML Schema Substitution Groups [XML Schema: Datatypes] provides the ability to include two or more element names in a substitution group. XPath 2.0 SHOULD be able to test whether an element is a member of an XML Schema substitution group. Satisfied by ElementTest and AttributeTest in [XPath 2.0].
|
||||
5.4 |
Should Support Lookups
Based on Schema Unique Constraints and Keys [XML Schema: Datatypes]
supports named, multi-part keys. XPath 2.0 SHOULD support
a mechanism for looking up the element to which a Schema
key refers. Similar mechanisms already exist, such as the
Not Satisfied due to lack of use cases and existing functionality in host languages to create keys. |