1 Introduction

The XPointer xpointer() scheme is intended to be used with the XPointer Framework [XPtrFrame] to provide a high level of functionality for addressing portions of XML documents. It is based on XPath [XPath], and adds the ability to address strings, points, and ranges in accordance with definitions provided in DOM 2: Range.[DOM2] This scheme supports addressing into the internal structures of XML documents and external parsed entities. It allows for examination of a document's hierarchical structure and choice of portions based on various properties, such as element types, attribute values, character content, and relative position. In particular, it provides for specific reference to elements, character strings, and other XML information, whether or not they bear an explicit ID attribute.

The xpointer() scheme is built on top of the XML Path Language [XPath], which is a joint expression language also underlying the XSL Transformations (XSLT) language. The xpointer() scheme's extensions to XPath add the ability to identify locations that are not single, whole elements (such as those corresponding to typical selections and selection points in some user interfaces), and to combine string matching with the other location methods provided.

The xpointer() scheme does not cover addressing into the internal structures of DTDs or the XML declaration.

1.1 Origin and Goals

In addition to XPath, a number of prior systems and standards have helped guide the development of this specification; these are listed in the non-normative references section.A.2 Non-Normative References See the XPointer Requirements Document [XPREQ] for a thorough explanation of requirements for the design of the xpointer() scheme.

1.2 Notation and Document Conventions

[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 xpointer() scheme is given using simple Extended Backus-Naur Form (EBNF) notation, as described in the XML Recommendation [XML].

The prototypes for xpointer() scheme functions are given using the same notation used in the [XPath] Recommendation.

This specification explicitly extends some aspects of the syntax and semantics of XPath (mainly in relation to support for locations other than whole nodes). Except in such cases, [XPath] constructs and definitions remain in effect in the xpointer() scheme.