W3C

XML Path Language (XPath) Version 1.0 Specification Errata

This version:
http://www.w3.org/1999/11/REC-xpath-19991116-errata
Last modified:
1 November 2001 by Jonathan Marsh
2 November 2005 by Joanne Tong
This document records known errors in the document:
http://www.w3.org/TR/1999/REC-xpath-19991116
The latest version of the XML Path Language (XPath) Version 1.0 specification is at:
http://www.w3.org/TR/xpath

Comments on this specification may be sent to www-xpath-comments@w3.org.

Known errors as of 2 November 2005

Section 1

Append the following paragraph to this section:

In addition, XML 1.0 and XML Names 1.0 references are always used for convenience. However, an implementation may choose to support [XML] and [XML Names]., or [XML 1.1] and [XML Names 1.1] lexical specification. Thus, URI references are also always used though IRI may also be supported. In some cases, the XML 1.0 and XML 1.1 definitions may be exactly the same.

Section 3.7

Append the following paragraph to this section:

A host language may choose whether the lexical rules of [XML] and [XML Names] are followed, or alternatively, the lexical rules of [XML 1.1] and [XML Names 1.1] are followed.

Section 5.4

Replace the first and second bullet:

With:

NOTE: undeclaring prefixes can only occur in documents that conform to [XML Names 1.1].

Appendix A.1

Add the following references:

XML 1.1
World Wide Web Consortium. Extensible Markup Language (XML) 1.1. W3C Recommendation. See http://www.w3.org/TR/xml11/
XML Names 1.1
World Wide Web Consortium. Namespaces in XML 1.1. W3C Recommendation. See http://www.w3.org/TR/xml-names11/

Known errors as of 1 November 2001

Appendix A.2

Replace the XML Infoset reference with:

XML Infoset
World Wide Web Consortium. XML Information Set. W3C Recommendation. See http://www.w3.org/TR/xml-infoset

Appendix B

Replace Appendix B with the following:

B XML Information Set Mapping (Non-Normative)

The nodes in the XPath data model can be derived from the information items provided by the XML Information Set [XML Infoset] as follows:

B.1. The Root Node

An instance of the XPath Data Model contains exactly one root node, which corresponds to the unique document information item in an XML Information Set.

  • The children of the root node are nodes corresponding to the information items found in the [children] property, omitting any document type declaration information items.

B.2. Element Nodes

An element node corresponds to an element information item.

  • The children of the element node are nodes corresponding to the information items appearing in the [children] property. This correspondence is not one-to-one, as consecutive character information item children are coalesced into a single text node. Because the XPath data model requires that all general entities be expanded, there will never be unexpanded entity reference information item children.

  • The attributes of the element node are nodes corresponding to attribute information items appearing in the [attributes] property.

  • The namespaces of the element node are nodes corresponding to namespace information items appearing in the [in-scope namespaces] property.

  • The local part of the expanded-name of the element node corresponds to the [local name] property. The namespace URI of the expanded-name of the element node corresponds to the [namespace name] property.

  • The unique ID of the element node corresponds to the [normalized value] property of the attribute information item in the [attributes] property that has an [attribute type] property of ID, if such an attribute exists, otherwise null.

  • The parent of the element node corresponds to the [parent] property.

B.3. Attribute Nodes

An attribute node corresponds to an attribute information item. Namespace declarations are not modelled as attributes.

  • The local part of the expanded-name of the attribute node corresponds to the [local name] property. The namespace URI of the expanded-name of an attribute node corresponds to the [namespace name] property.

  • The string-value of the attribute node corresponds to the [normalized value] property.

  • The parent of the attribute node corresponds to the [owner element] property.

B.4. Text Nodes

A text node corresponds to a sequence of one or more consecutive character information items.

  • The string-value of the node text corresponds to the concatenated [character code] properties of each of the character information items.

  • The parent of the text node corresponds to the [parent] property of any one of the consecutive character information items (consecutive characters always have the same parent).

B.5. Processing Instruction Nodes

A processing instruction node corresponds to a processing instruction information item. There are no processing instruction nodes for processing instructions that are children of a document type declaration information item.

  • The local part of the expanded-name of the processing instruction node corresponds to the [target] property. The namespace URI part of the expanded-name of a processing instruction node is null.

  • The string-value of the processing instruction node corresponds to the [content] property.

  • The parent of the processing instruction node corresponds to the [parent] property.

B.6. Comment Nodes

A comment node corresponds to a comment information item.

  • The string-value of the comment node corresponds to the [content] property.

  • The parent of the comment node corresponds to the [parent] property of the comment information item.

B.7. Namespace Nodes

A namespace node corresponds to a namespace information item.

  • The local part of the expanded-name of the namespace node corresponds to the [prefix] property. The namespace URI part of the expanded-name of the namespace node is null.

  • The string-value of the namespace node corresponds to the [namespace name] property.

  • The parent of the namespace node is the element node in whose namespaces collection this node appears.

B.8. XML Information Set Conformance

This specification conforms to the XML Information Set [XML Infoset]. The following information items must be exposed by the infoset producer to construct an instance of the data model:

  • The Document Information Item with [children] properties.

  • Element Information Items with [children], [attributes], [in-scope namespaces], [local name], [namespace name] and [parent] properties.

  • Attribute Information Items with [namespace name], [local name], [normalized value], [owner element] and [attribute type] properties.

  • Character Information Items with [character code] and [parent] properties.

  • Processing Instruction Information Items with [target], [content] and [parent] properties.

  • Comment Information Items with [content] and [parent] properties.

  • Namespace Information Items with [prefix] and [namespace name] properties.

Any other information items and properties made available by the Infoset processor are ignored.


Known errors as of 29 September 2000

Section 2.2

In the last bullet change "ancestor axis" to "ancestor-or-self axis".

Section 2.5

In the fourth unbulleted paragraph, div/descendant-or-self::node()/child::para should be child::div/descendant-or-self::node()/child::para.

Section 3.5

The semantics of unary minus were unspecified. Replace the fourth paragraph by the following:

The binary - operator performs subtraction. The unary - operator performs negation. Note that -0 evaluates to negative zero.

The semantics of the * operator were unspecified. Add the following paragraph immediately before the paragraph specifying the div operator:

The * operator performs floating-point multiplication according to IEEE 754. Note that, if the result is not NaN, the result is positive if and only if both operands have the same sign.

Add the following sentence to the paragraph describing the div operator:

Note that, if the result is not NaN, the result is positive if and only if both operands have the same sign.

Section 3.7

Replace:

ExprWhitespace may be freely added within patterns before or after any ExprToken

by:

ExprWhitespace may be freely added within expressions before or after any ExprToken

Since FunctionName can have a prefix, the second bullet should be changed to refer to QNames rather than NCNames.

Section 4.2

Add the following to the description of the starts-with function:

If the second argument string is the empty string, then true is returned.

Add the following to the description of the contains function:

If the second argument string is the empty string, then true is returned.

Add the following to the description of the substring-before function:

If the second argument string is the empty string, then the empty string is returned.

Add the following to the description of the substring-after function:

If the second argument string is the empty string, then the first argument string is returned.

Section 4.4

Add the following to the description of the floor function:

If the argument is NaN, then NaN is returned. If the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is greater than zero, but less than 1, then positive zero is returned.

Add the following to the description of the ceiling function:

If the argument is NaN, then NaN is returned. If the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than -1, then negative zero is returned.

Section 5

The treatment of namespace names that are relative URIs is implementation-dependent, in accordance with the W3C XML Plenary decision.

Replace:

The namespace URI specified in the XML document can be a URI reference as defined in [RFC2396]; this means it can have a fragment identifier and can be relative. A relative URI should be resolved into an absolute URI during namespace processing: the namespace URIs of expanded-names of nodes in the data model should be absolute.

with:

A namespace name specified in a namespace declaration in an XML document is a URI reference as defined in [RFC2396]; this implies it can have a fragment identifier and can be relative. The namespace URI component of an expanded-name is implementation-dependent if the expanded-name is expanded from a QName whose prefix is declared by a namespace declaration with a namespace name that is a relative URI (with or without a fragment identifier). An XPath expression that depends on the value of the namespace URI component of such expanded-names is not interoperable.

Similarly in section 5.4, replace:

The string-value of a namespace node is the namespace URI that is being bound to the namespace prefix; if it is relative, it must be resolved just like a namespace URI in an expanded-name.

with:

The string-value of a namespace node is the namespace URI that is being bound to the namespace prefix; if the namespace name occurring in the namespace declaration in the XML document is a relative URI (with or without a fragment identifier), then the string-value is implementation-dependent. An XPath expression that depends on the string-value of such namespace nodes is not interoperable.

Section 5.7

Add the following to the penultimate paragraph:

Whitespace outside the document element does not produce text nodes.

Webmaster