This document is also available in the following non-normative format: XML (DTD, XSL).
Copyright © 2002 W3C® (MIT, INRIA, Keio), All Rights Reserved. W3C liability, trademark, document use, and software licensing rules apply.
The XPointer element()
scheme is intended to be used with the XPointer Framework [XPtrFrame] to allow basic addressing of XML elements.
This is a Last Call W3C Working Draft for review by W3C members and other interested parties. It is a draft document and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use W3C Working Drafts as reference material or to cite them as other than "work in progress." Comments on this document should be sent no later than 31 July 2002 to the public mailing list www-xml-linking-comments@w3.org (archive).
This document has been produced by the W3C XML Linking Working Group as part of the XML Activity. The goals of this work are set out in the XPointer Requirements document.
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.
Even though it has not been seen before in this form, this specification
is being published as a Last Call Working Draft because it is essentially
a subset of the previous specification. This specification takes the XPointer
shorthand form that was in the XPointer
Candidate Recommendation published on 11 September 2001 and puts it
into an element()
scheme. Note that the "bare names" functionality
has been extended slightly to include a schema-based ID addressing option.
We are specifically seeking input on what the XML Linking WG should recommend
as a minimum conformance level for the purposes of XPointer usage in fragment
identifiers for any resource whose Internet media type is one of text/xml
,
application/xml
,
text/xml-external-parsed-entity
,
or application/xml-external-parsed-entity
. Actually
specifying this level is an issue that will have to be taken up normatively
in the successor to IETF RFC 3023 [RFC 3023].
A list of current W3C Recommendations and other technical documents can be found at http://www.w3.org/TR/
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, pointer part, scheme, XPointer processor, application, error, failure, and namespace binding context are used in this specification as defined in the XPointer Framework specification. Note that errors defined by this specification are distinct from XPointer Framework errors.
The formal grammar for the element()
scheme is given using simple Extended
Backus-Naur Form (EBNF) notation, as described in the XML Recommendation [XML].
This specification normatively depends on the XPointer Framework [XPtrFrame] specification.
XPointer processors supporting the element()
scheme normatively depend on
sufficient input about an XML resource to identify the XML Information Set [Infoset] and XML Schema [XSD] 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.
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, it is an element()
scheme error
and the pointer part fails.
[1] | elementschemedata | ::= | (Name, childseq?) | childseq |
[2] | childseq | ::= | ('/' [1-9] [0-9]* )+ |
The scheme data consists of either a Name (as defined in the XML specification [XML]) or a child sequence, or both.
A Name appearing alone identifies a single element exactly as for the Name shorthand form defined in the XPointer Framework [XPtrFrame] specification, except that failure to identify a subresource results in pointer part failure rather than an XPointer Framework error.
For example, the following pointer part identifies the element with an ID (as defined in XPointer Framework) of "foo":
element(foo)
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 following the first slash represents the nth top-level element: either the unique document element (the [document element] property, if the resource is an XML document, 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:
element(/1/2)
A child sequence appearing after a Name 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 as follows 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:
element(intro/3/1)
If either the Name or the child sequence does not locate an element, no element is identified by the pointer part as a whole and the pointer part fails.
The element()
scheme does not use the namespace binding context because
it does not contain any qualified names.