XPointer element() Scheme

W3C Proposed Recommendation 13 November 2002

This version:
Latest version:
Previous version:
Paul Grosso, Arbortext, Inc. <paul@arbortext.com>
Eve Maler, Sun Microsystems <eve.maler@sun.com>
Jonathan Marsh, Microsoft <jmarsh@microsoft.com>
Norman Walsh, Sun Microsystems <Norman.Walsh@Sun.COM>

This document is also available in these non-normative formats: XML.


The XPointer element() scheme is intended to be used with the XPointer Framework [XPtrFrame] to allow basic addressing of XML elements.

Status of this Document

This document is a Proposed Recommendation (PR) of the W3C. This document has been produced by the W3C XML Linking Working Group as part of the XML Activity. It is intended to address a subset of the original XPointer requirements, and to serve as a possible part of a recommendation to the IETF for a fragment identifier syntax for the XML Mime types.

W3C Advisory Committee Members are invited to send formal review comments to the W3C Team until 13 December 2002 at team-xptr-review@w3.org. The public is invited to send comments to the public mailing list www-xml-linking-comments@w3.org (archive). After the review the Director will announce the document's disposition. This announcement should not be expected sooner than 14 days after the end of the review.

This document is based upon the XPointer Candidate Recommendation published on 11 September 2001. Feedback received during that review and a lack of a sufficient number of complete implementations led the Working Group to factor the basic functionality specified there into four specifications: the XPointer Framework, the XPointer xmlns() Scheme, the XPointer element() scheme (this specification), and the XPointer xpointer() scheme. This specification subsequently went through an additional Last Call period. The XML Linking Working Group believes that this specification addresses all relevant Last Call and Candidate Recommendation issues, and represents an interoperable subset of the implementations documented in the previous Implementation Report, and thus that a further Candidate Recommendation period is not necessary. Information about more recent implementations of subsets relevant to this specification and the XPointer xmlns() Scheme and XPointer Framework can be found in the new Implementation Report. Other specifications such as XInclude 1.0 already make normative references to this specification, which makes timely progression to Recommendation desirable.

There are patent disclosures and license commitments associated with this working draft, which may be found on the XPointer IPR Statement page in conformance with W3C policy.

Publication as a Proposed Recommendation does not imply endorsement by the W3C membership. This is still a draft document and may be updated, replaced or made obsolete by other documents at any time. It is inappropriate to cite a W3C Proposed Recommendation as other than a "work in progress." A list of current W3C Recommendations and other technical documents can be found at http://www.w3.org/TR/.

Table of Contents

1 Introduction
2 Conformance
3 Language and Processing


A Normative References

1 Introduction

The XPointer element() scheme is intended to be used with the XPointer Framework [XPtrFrame] to allow basic addressing of XML elements.

[Definition: The key words must, must not, required, shall, shall not, should, should not, recommended, may, and optional in this specification are to be interpreted as described in [RFC 2119].]

The terms pointer part, scheme, XPointer processor, error, and namespace binding context are used in this specification as defined in the XPointer Framework specification.

The formal grammar for the element() scheme is given using simple Extended Backus-Naur Form (EBNF) notation, as described in the XML Recommendation [XML].

2 Conformance

This specification normatively depends on the XPointer Framework [XPtrFrame] specification.

XPointer processors supporting the element() scheme depend on the ability of applications to expose an XML resource as at least the XML Information Set [Infoset] and XML Schema [XMLSchema] information items and properties listed in the XPointer Framework specification.

Conforming XPointer processors claiming to support the element() scheme must conform to the behavior defined in this specification and may conform to additional XPointer scheme specifications.

3 Language and Processing

This section describes the syntax and semantics of the element() scheme and the behavior of XPointer processors with respect to this scheme.

The scheme name is "element". The scheme data syntax is as follows; if scheme data in a pointer part with the element() scheme does not conform to the syntax defined in this section the pointer part does not identify a subresource.

element() Scheme Syntax
[1]   ElementSchemeData   ::=   (NCName ChildSequence?) | ChildSequence
[2]   ChildSequence   ::=   ('/' [1-9] [0-9]*)+

The scheme data consists of either a NCName (as defined in the XML namespaces specification [XML-Names]) or a child sequence, or both.

A NCName appearing alone identifies a single element exactly as it would in a shorthand pointer, as defined in the XPointer Framework [XPtrFrame] specification, except that failure to identify an element results simply in no subresource being identified by this pointer part rather than an XPointer Framework error.

For example, the following pointer part identifies the element with an ID (as defined in XPointer Framework) of "intro":


A child sequence appearing alone identifies an element by means of stepwise navigation, which is directed by a sequence of integers separated by slashes (/); each integer n locates the nth child element of the previously located element. The integer n following the first slash locates the nth top-level element: either the unique document element (the [document element] property, if the resource is an XML document, in which case the integer is always 1) or one of potentially several root elements (the entity root element(s), if the resource is an external parsed entity). For example, assuming that the XML resource is a whole XML document, the following pointer part identifies the second child element inside the root element of the document:


A child sequence appearing after an NCName identifies an element by means of stepwise navigation, starting from the element located by the given name. For example, the following pointer part identifies an element by first locating the element identified by the value "intro", then locating that element's third child element, then finally identifying that element's first child element:


If either the NCName or the child sequence does not locate an element, no element is identified by the pointer part as a whole.

The element() scheme does not use the namespace binding context because it does not support qualified names.

A Normative References

John Cowan and Richard Tobin, editors. XML Information Set. World Wide Web Consortium, 2001.
RFC 2119
Scott Bradner, RFC 2119: Key words for use in RFCs to Indicate Requirement Levels. Internet Engineering Task Force, 1997.
Tim Bray, Jean Paoli, C.M. Sperberg-McQueen, and Eve Maler, editors. Extensible Markup Language (XML) 1.0 (Second Edition). World Wide Web Consortium, 2000.
Tim Bray, Dave Hollander, and Andrew Layman, editors. Namespaces in XML. World Wide Web Consortium, 1999.
Paul Grosso, Eve Maler, Jonathan Marsh, and Norman Walsh, editors. XPointer Framework. World Wide Web Consortium, 2002.
Henry Thompson et al., editors. XML Schema Part 1. World Wide Web Consortium, 2001.