application/xml
, text/xml-external-parsed-entity
, or application/xml-external-parsed-entity
">
]>
&abstract;
This document is a
This document has been produced by the
Public comments on this Recommendation are welcome. Please send them to
the public mailing list
Information about implementations relevant to this
specification and the accompanying
There are patent disclosures and license commitments associated with
this Recommendation, which may be found on the
A list of current W3C Recommendations and other technical documents can
be found at
So out of date it's been dropped
&abstract;
Many types of XML-processing applications need to address into the internal structures of XML resources using URI references, for example, the XML Linking Language
The formal grammar for the &framework; is given using simple Extended Backus-Naur Form (EBNF) notation, as described in the XML Recommendation
A string conforming to this specification. This specification defines the syntax and semantics of pointers.
A portion of a pointer that provides a scheme name and some pointer data that conforms to the definition of that scheme. The XPointer processor evaluates a pointer part to identify zero or more subresources within an XML resource.
A specialized pointer data format that has a name and is defined in a specification.
A software component that identifies subresources of an XML resource by applying a pointer to it. This specification defines the behavior of XPointer processors.
A software component that incorporates or uses an XPointer processor because it needs to access XML subresources. The occurrence and usage of XPointers, and the behavior to be applied to resources and subresources obtained by processing those XPointers, are governed by the definition of each application's corresponding data format (which could be XML-based or non-XML-based). For example, HTML
A violation of the syntactic rules of this specification, or the failure of a pointer to identify subresources.
A binding of XML-namespace-defined
This specification defines a framework; it does not currently define a minimum conformance level for XPointer processors. Thus, the information in this section defines conformance requirements only for the framework portion of any minimum conformance level.
XPointer processors depend on the ability of applications to reverse any fragment identifier encoding and escaping (see
XPointer processor behaviour depends on the availability of certain
information from an XML resource: in the terms provided by the
From the XML Information Set itself
Note that if the XML resource is not a document but rather an external parsed entity, this property will not be reported. Rather, the information set is effectively extended to report the one or more top-level elements in the entity as ordered root element
properties for the entity.
From the XML Schema post-schema validation information set (PSVI)
Either:
and the
or:
Software components claiming to be XPointer processors
Conforming XPointer processors
This section describes the &framework; and the behavior of XPointer processors with respect to the framework.
An XPointer processor takes as input an XML resource and a string to be used as a pointer (for example, a fragment identifier, with escaping reversed, taken from the URI reference that was used to access the resource), attempts to evaluate the pointer with respect to the resource, and produces as output an identification of subresources, or one or more errors.
If a string used as a pointer does not adhere to the syntax defined in this section, it is an error.
The symbol
As shown in the above productions, the end of a pointer part is signaled by the right parenthesis
character that balances the left parenthesis )
character that began the part. If either a left or a right parenthesis occurs in scheme data without being balanced by its counterpart, it (
^
) character preceding it. Escaping pairs of balanced parentheses is allowed. Any literal occurrences of the circumflex ^^
). Any other use of a circumflex is an error.
A shorthand pointer, formerly known as a barename, consists of an
If an element information item has an attribute information item
among its
If an element information item has an element information item
among its
If an element information item has an attribute information item
among its
An element information item may also be identified by an
If no element information item is identified by a shorthand pointer's
An element information item might be identified by multiple values, in a document with more than one of
It has a ID
and http://www.w3.org/2001/XMLSchema
;
It
has a
It has a
It has a ID
and a http://www.w3.org/2001/XMLSchema
;
It has a ID
and a http://www.w3.org/2001/XMLSchema
.
ID
.
A shorthand pointer provides, for resources with XML-based media types,
a rough analog of HTML fragment identifier behavior. However, if
The above definitions are
A scheme-based pointer consists of one or more pointer parts, optionally separated by white space (
When multiple pointer parts are provided, an XPointer processor
In the following example, if the 'xpointer' pointer part is not understood or fails to identify any subresources, the 'element' pointer part is evaluated. If the 'xpointer' pointer part identifies subresources, the 'element' pointer part is not evaluated.
A scheme name consists syntactically of an optional
This specification reserves all unqualified scheme names for definition in additional XPointer schemes defined in W3C Recommendations. The use of
Scheme specifications
In the following example, the 'xmlns' scheme (see img:rect
denotes the name of a scheme that it supports.
The initial namespace binding context prior to evaluation of the first pointer part consists of a single entry: the xml
prefix bound to the namespace name http://www.w3.org/XML/1998/namespace
. The namespace binding context is subject to the following constraints; attempts to violate these constraints will have no effect on the namespace binding context:
The xml
prefix is bound to the namespace name http://www.w3.org/XML/1998/namespace
. It
The namespace name http://www.w3.org/XML/1998/namespace
is bound to the prefix xml
. It
The xmlns
prefix
The namespace name http://www.w3.org/2000/xmlns/
Prefixes beginning with the three-letter sequence x, m, l, in any case combination, are reserved. Users
The set of characters for XPointers is
The following contexts require various types of escaping to be applied to XPointers:
As described in
%
) escaped because it is the character used for escaping in URIs and IRIs.
Thus, when a pointer is inserted into an IRI reference, any occurrences of percent signs (%
)
Each character to be escaped is converted to UTF-8
The resulting bytes are escaped with the URI escaping mechanism (that is, converted to %HH, where HH is the hexadecimal notation of the byte value).
The original character is replaced by the resulting character sequence.
For example %
becomes %25
.
IRI references can be converted to URI references for consumption by URI resolvers. The disallowed characters in URI references include all non-ASCII characters, plus the excluded characters listed in Section 2.4 of
Each disallowed character is converted to UTF-8
The resulting bytes are escaped with the URI escaping mechanism (that is, converted to %HH, where HH is the hexadecimal notation of the byte value).
The original character is replaced by the resulting character sequence.
If a pointer appears in an XML document or external parsed entity, any characters not expressible in the encoding used
Since the XPointer processor will reverse only the escaping of XPointer-significant characters (A), the application must reverse any other encodings or escapings (such as B, C, or D) that the pointer was subject to. If the result passed to the XPointer processor does not conform to the syntactic rules for XPointers in this specification, it is an error.
The following table shows the escaping in various contexts of an XPointer containing an unbalanced parenthesis, double quotation marks, and spaces. These examples use the 'xpointer' scheme (see
Context | Notation |
---|---|
Initial Scheme Data | The xpointer scheme data as it was initially created: |
A. XPointer | With the unbalanced parenthesis in the scheme data escaped, as required by this specification: |
B. Pointer in IRI reference | Same as A (no percent sign found that needs escaping): |
C. IRI reference converted to URI reference | With occurrences of the double quotatation marks (%22 ), spaces
(%20 ), and circumflexes (%5E ) escaped: |
D. IRI reference in XML document | Double quotation marks escaped using XML's predefined " entity reference (assuming that the pointer appears in an IRI reference in a double-quoted attribute value): |
The following table shows the escaping of an XPointer containing accented characters in various contexts. The XML document is assumed to be encoded in US-ASCII
, which does not allow the letter é
to appear directly.
Context | Notation |
---|---|
Initial Scheme Data | The xpointer scheme data as it was initially created: |
A. XPointer | The XPointer (no circumflexes or unbalanced parentheses in scheme data that need escaping): |
B. Pointer in IRI reference | Same as A (no percent sign found that needs escaping): |
C. IRI reference converted to URI reference | With occurrences of the letter é( %C3%A9 ) escaped: |
D. IRI reference in XML document | Represented in the US-ASCII encoding; accented letters are escaped with XML character references: |