Copyright © 2005 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark, and document use 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 includes, for each requirement, a corresponding status, indicating the current situation of the requirement in the XPath 2.0 family of specifications at the time that they are being issued as Last Call Working Drafts in April, 2005.
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).
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/).
As of this publication, the Working Group expects to eventually publish this document as a Working Group Note. It is not expected to become a W3C Recommendation, and therefore it has no associated W3C Patent Policy licensing obligations.
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 Introduction 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 Quantified Expressions in [XPath 2.0].
|
||||
1.4 |
Must Extend Set of
Aggregation Functions XPath 1.0 currently supports Satisfied by section Aggregate Functions 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 Backwards Compatibility with XPath 1.0 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 Combining Node 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 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 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 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 existential quantification in 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 String Functions that Use Pattern Matching 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 eg: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 fn:upper-case and 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 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 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 Constructor Functions and 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 section Sequences in [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 Typed Value and String Value 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 [XPath 2.0] language.
|
||||
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 SequenceType Matching 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. |