<?xml version='1.0'?>
<?xml-stylesheet type="text/xsl" href="xmlspec.xsl"?>
<!DOCTYPE spec PUBLIC "-//W3C//DTD Specification V2.1//EN" "xmlspec-v21.dtd" [
<!ATTLIST spec xml:lang CDATA #IMPLIED>
<!ENTITY pub-day "11">
<!ENTITY iso6.doc.date "20010911">
<!ENTITY pub-month "September">
<!ENTITY pub-year "2001">
<!ENTITY media-types "one of <code>text/xml</code>, 
<code>application/xml</code>, 
<code>text/xml-external-parsed-entity</code>,
or <code>application/xml-external-parsed-entity</code>">
<!ENTITY pub-type "CR">
<!ENTITY pub-lc-type "cr">
<!ENTITY pub-base "http://www.w3.org/TR/2001/&pub-type;-xptr-&iso6.doc.date;">
<!ENTITY pub-uri "&pub-base;/xptr">
<!ENTITY XLink "http://www.w3.org/TR/xlink">
<!ENTITY XML "http://www.w3.org/TR/REC-xml">
<!ENTITY XMLNames "http://www.w3.org/TR/REC-xml-names">
<!ENTITY XPath "http://www.w3.org/TR/xpath">
<!ENTITY Issues "http://www.w3.org/XML/Group/1999/07/LinkingIssueList">
<!ENTITY RFC2396 "http://www.rfc-editor.org/rfc/rfc2396.txt">
]>
<spec w3c-doctype="&pub-lc-type;" xml:lang="en">
<!--
Last edited: Tue Sep 11 2001 by HST
-->
<header>
<title>XML Pointer Language (XPointer)</title>
<version>Version 1.0</version>
<w3c-designation>&pub-base;</w3c-designation>
<w3c-doctype>W3C Candidate Recommendation</w3c-doctype>
<pubdate><day>&pub-day;</day><month>&pub-month;</month><year>&pub-year;</year>
</pubdate>
<publoc>
<loc href="&pub-base;/">&pub-base;/</loc> (in <loc href="&pub-uri;.xml">XML</loc> (with its own <loc href="&pub-base;/xmlspec-v21.dtd">DTD</loc>, <loc href="&pub-base;/xmlspec.xsl">XSL
stylesheet</loc>) and <loc href="&pub-uri;.html">HTML</loc>)
</publoc>
<prevlocs>
<loc href="http://www.w3.org/TR/2001/WD-xptr-20010108/">http://www.w3.org/TR/2001/WD-xptr-20010108/</loc>
<!--
http://www.w3.org/TR/2000/CR-xptr-20000607
http://www.w3.org/TR/1999/WD-xptr-19991206--></prevlocs>
<latestloc><loc href="http://www.w3.org/TR/xptr">http://www.w3.org/TR/xptr</loc></latestloc>
<authlist>
<author><name>Steven DeRose</name><affiliation>Brown University 
Scholarly Technology
Group</affiliation><email href="mailto:Steven_DeRose@Brown.edu">Steven_DeRose@Brown.edu</email>
</author>
<author><name>Eve Maler</name><affiliation>Sun Microsystems</affiliation>
<email href="mailto:elm@east.sun.com">eve.maler@east.sun.com</email></author>
<author><name>Ron Daniel Jr.</name><affiliation>Interwoven</affiliation><email href="mailto:rdaniel@interwoven.com">rdaniel@interwoven.com</email></author>
</authlist>
<abstract>
<p>This specification defines the XML Pointer Language (XPointer), the language
to be used as the basis for a fragment identifier for any URI reference that
locates a resource whose Internet media type is &media-types;.</p>
<p>XPointer, which is based on the XML Path Language (XPath), 
supports addressing
into the internal structures of XML documents and external parsed entities.
It allows for examination of
a hierarchical document structure and choice of its internal parts based on
various properties, such as element types, attribute values, character content,
and relative position.</p>
</abstract>
<status>
 <p>This document is a Candidate Recommendation of the World Wide Web
Consortium. (For background on this work, please see the <loc href="http://www.w3.org/XML/Activity">XML
Activity Statement</loc>.) This specification is considered stable by the <loc href="http://www.w3.org/XML/Activity#linking-wg">XML Linking
Working Group</loc> and is available for public review.
</p>
 <p>The Working Group invites implementation feedback on this
specification.  We expect that sufficient feedback to determine its
future will have been received by 4 March 2002.  Comments on
this document should be sent to the public mailing list
<loc href="mailto:www-xml-linking-comments@w3.org">www-xml-linking-comments@w3.org</loc>
(<loc href="http://lists.w3.org/Archives/Public/www-xml-linking-comments/">archive</loc>). While we welcome
implementation experience reports, the XML Linking Working Group
will not allow early implementation to constrain its ability to make
changes to this specification prior to final release.</p>
 <p>This document is intended to be taken in conjunction with the IETF
XML Media Types Internet Draft <bibref ref="draft-xmlmediatypes"/>,
which anticipates an IETF official designatation of XPointer as the
fragment identifier language for resources whose type is one of
&media-types;. However, because of the
timing problems associated with publishing two related documents on
separate tracks, currently that document refers to this one only
non-normatively.</p>
 <p>It is possible that XPointer might proceed to Recommendation status,
for use in sophisticated high-end pointing applications, without
being incorporated into <bibref ref="draft-xmlmediatypes"/>.  Before recommending to the IETF
that the <bibref ref="draft-xmlmediatypes"/> Internet Draft be updated to make a normative
reference to XPointer, Member feedback is urgently solicited on the
following points:</p>
 <olist>
  <item><p>In the course of implementing the XPointer design as presented herein,
were any aspects or subparts encountered which caused significant
implementation difficulty?</p></item>
  <item><p>If so, would eliminating some or all of the
difficult-to-implement aspects or subparts leave a coherent design
still useful for your needs?</p></item>
  <item><p>Does your implementation experience suggest reasons why the
XPointer language as defined herein should not be recommended to the
IETF as the fragment identifier language for resources of type
<code>text/xml</code> etc.?</p></item>
 </olist>
 <p>In addition to the specific points above, any feedback on patterns of
implementation and use of this specification would be very welcome.</p>
<!--The English version of this specification is
the only normative version. However, for translations of
this document, see @@.-->
<p>For information about the XLink language with which
XPointer <termref def="dt-must">may</termref> be used, see <loc href="http://www.w3.org/TR/xlink/">http://www.w3.org/TR/xlink/</loc>.</p>
 <p>For information about the requirements that informed development of 
this specification,
see <loc href="/TR/NOTE-xptr-req">http://www.w3.org/TR/NOTE-xptr-req</loc>.</p>
 <p>A list of current W3C Recommendations and other technical documents can be
found at <loc href="http://www.w3.org/TR/">http://www.w3.org/TR/</loc>.  W3C
publications may be updated, replaced, or obsoleted
by other documents at any time. In particular it is inappropriate to use W3C Working Drafts as reference material or to cite them as other than <quote>work in progress</quote>.</p>
</status>
<pubstmt>
<p>Cambridge, MA: World-Wide Web Consortium, XML Linking Working Group,
1998-2001. Previous Working Drafts were developed by the XML Working Group.</p>
</pubstmt>
<sourcedesc>
<p>Created in electronic form.</p>
</sourcedesc>
<langusage>
<language id="en">English</language>
<language id="ebnf">Extended Backus-Naur Form (formal grammar)</language>
</langusage>
<revisiondesc>
<slist>
<sitem>1997-01-15 : Skeleton draft by TB</sitem>
<sitem>1997-01-24 : Fleshed out by sjd</sitem>
<sitem>1997-04-08 : Substantive draft</sitem>
<sitem>1997-06-30 : Public draft</sitem>
<sitem>1997-08-01 : Public draft</sitem>
<sitem>1997-08-05 : Prose/organization work by sjd</sitem>
<sitem>1997-10-14: Conformance and design principles; a bit of cleanup by
elm</sitem>
<sitem>1997-11-07: Update for editorial issues per issues doc, by sjd.</sitem>
<sitem>1997-12-01: Update for editorial issues per issues doc in preparation
for F2F meeting, by sjd.</sitem>
<sitem>1998-01-13: Editorial cleanup, addition of new design principles, by
elm.</sitem>
<sitem>1998-02-27: Splitting out of XLink and XPointer; span syntax changes;
dots between location terms; other issue cleanup; by elm.</sitem>
<sitem>1998-03-02: Review and fix remaining details from split. sjd/elm</sitem>
<sitem>1998-10-15: Address editorial corrections reported by working group
members, external reviewers and implementers.</sitem>
<sitem>1999-02-15: Complete editorial corrections and review.</sitem>
<sitem>1999-04-20: Begin synchronizing with XSL specification.</sitem>
<sitem>1999-05-19: Reference XPL directly for common portions; sjd/rd.</sitem>
<sitem>1999-06-24: Organize for informative/normative; editorial 
fixes; sjd.</sitem>
<sitem>1999-09-22: Incorporate James Clark's suggestions on ranges; rd.</sitem>
<sitem>1999-10-14: Cleanups, addition of Positions; rd</sitem>
<sitem>1999-10-14: Sync to XPath PR, editorial pass, etc.; sjd</sitem>
<sitem>1999-10-28: cleanups; rd</sitem>
<sitem>1999-11-06: changes suggested by J Marsh and agreed by WG; rd</sitem>
<sitem>1999-11-10: editing pass. sjd</sitem>
<sitem>1999-11-22: editing pass. elm</sitem>
<sitem>2000-03-20: incorporate decisions made during the past month. 
elm</sitem>
<sitem>2000-04-11: fixed items that I forgot on the last round (uncovered
by DV and BT); changed handling of unique(); switched from 
&ldquo;sub-resource&rdquo;
to &ldquo;fragment&rdquo; and from &ldquo;general fragment part&rdquo; to
&ldquo;fragment ID part&rdquo;. elm</sitem>
<sitem>2000-04-18: More edits, getting ready for CR request. elm</sitem>
<sitem>2000-04-24: Changed back use of &ldquo;fragment&rdquo; to 
&ldquo;sub-resource&rdquo;;
clarified the three forms of XPointer and added FullFragID 
non-terminal. -elm</sitem>
<sitem>2000-05-15: QName to NCName, lots of header/link fixes, change to CR
header stuff, disallow all schemes other than &ldquo;xpointer&rdquo;, 
distinguish
XPointers from (escaped) fragment identifiers, clarified namespace initialized.
-elm</sitem>
<sitem>2000-05-30: Updated XML media types reference. Added I-D info to Status
section. Defined &ldquo;string range&rdquo; and made fwd ref to it. Tweaked
conformance section intro. Added &ldquo;Encoding&rdquo; to 4.1 head. Referred
to RFC 2732 and explained bracket situation. Described reverse process of
un-encoding and un-escaping. Added full example of encoding/escaping. Separated
issues of URI and XML escaping. Added subsection on XPointer 
escaping. Explained
bidi better. Explained &ldquo;apparent Xptr&rdquo; handling for NS 
initialization.
Explained DOM char counting better. Clarified that string-range() matches
on ranges in string-values. Added prototype for start-point().</sitem>
<sitem>2000-11-06: Started working on CR DoC 
(www.w3.org/XML/2000/10/xptr-CR-comments.html).
For the moment, using &ldquo;diff markup&rdquo; so the WG members can review
the changes. -elm</sitem>
<sitem>2000-11-28: Next draft. -elm</sitem>
<sitem>2000-12-06: Incorporated some decisions from 30 November telecon (MD1,
MD3, though there's still an outstanding question, and MD4); also changed
David Durand's affiliation, as requested. -elm</sitem>
<sitem>2000-12-12: Incorporated decisions from 7 December telecon (MD2, MD7-9,
MD12-16); changed Ron Daniel's affiliation; used orglist instead of ulist
for the WG members. General edits in preparation for final PR publication.
-elm</sitem>
<sitem>2000-12-13: provisional changes in prep for 14 December telecon (see
agenda for that meeting). -elm</sitem>
<sitem>2000-12-14: Incorporated decisions from 14 December meeting. 
-elm</sitem>
<sitem>2000-12-22: Incorporated decisions from 21 December meeting, sending
this back to Last Call WD. -elm</sitem>
<sitem>2001-03-27: Incorporated decisions from 8 March meeting, 13 March,
and 22 March telecons. -elm</sitem>
<sitem>2001-03-27: Incorporated decisions from 29 March to 26 April telcons,
issues XP102-XP130. Proofing and consistency checks; check for refs to external
parsed entities. -sjd</sitem>
</slist>
</revisiondesc>
</header>
<body>
<div1>
<head>Introduction
</head>
<p>This specification defines the XML Pointer Language (XPointer), the language
defined to express fragment identifiers for any URI reference that 
locates a resource
whose Internet media type is &media-types; <bibref ref="draft-xmlmediatypes"/>.
This specification does not constrain the syntax or semantics of URI references
to resources of other media types, although it provides extension facilities
that <termref def="dt-must">may</termref> be used with other types.</p>
<p>XPointer 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 its internal parts 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.</p>
<p>The structures located with XPointer can be used as link targets or for
any other application-specific purpose. This specification does not constrain
what uses an application <termref def="dt-must">may</termref> make of locations
identified by XPointers. In particular, implementation of traversal 
to a resource
is not constrained by this specification, and whether user 
<quote>traversal</quote>
is the purpose of an XPointer at all is application-dependent. A formatted-text
browser traversal might scroll to and highlight the designated location; a
structure-oriented graphical viewer or a document-relationship display might
do traversal in quite a different way; and a search application, 
parser, archival
system, or expert agent might use XPointers for other purposes entirely. (The
construction of linking elements in XML documents that associate arbitrary
resources, including XML documents and portions thereof, is defined 
in a related
specification, <bibref ref="XLink"/>.)</p>
<p>XPointer is built on top of the XML Path Language <bibref ref="XPath"/>,
which is an expression language underlying the XSL Transformations (XSLT)
language. XPointer's extensions to XPath allow it to:</p>
<ulist>
<item><p>Be used in URI references to address into resources</p></item>
<item><p>Address points and ranges as well as whole nodes</p></item>
<item><p>Locate information by string matching</p></item>
</ulist>
<p>Addressing into the internal structures of DTDs and the XML declaration
is outside the scope of this specification.</p>
<note>
<p>XPointer is defined to be the fragment identifier language only 
for resources
whose media type is &media-types;. However, it is expected that many 
applications of
XML will define their own media types in order to indicate the particular
usage of XML they define. (Note that <bibref ref="draft-xmlmediatypes"/> recommends
a naming convention for specialized media types based on XML.) Schemes
(discussed in <specref ref="schemes"/>) can be used to provide specialized
addressing into the content of resources of those media types. XPointer
is also suitable for addressing the generic XML aspects of those media types
and as the basis for new fragment identifier
languages for other XML-based media types. </p>
</note>
<div2>
<head>Origin and Goals
</head>
<p>In addition to XPath, the following standards have been especially 
influential
in the development of this specification:</p>
<ulist>
<item><p><emph>HTML</emph> <bibref ref="html"/>: This system popularized an
important location specifier type, the URL (now URI).</p></item>
<item><p><emph>HyTime</emph> <bibref ref="iso10744"/>: This ISO 
standard defines
location specifier types for all kinds of data.</p></item>
<item><p><emph>Text Encoding Initiative Guidelines</emph> <bibref ref="tei"/>:
This application provides a formal syntax for <quote>extended pointers,</quote>
locators for structured markup that underlie the initial design for 
XPointer.</p>
</item>
</ulist>
<p>The addressing components of many other hypertext systems have also informed
the design of XPointer, especially <bibref ref="dexter"/>, <bibref ref="ohs"/>, <bibref ref="fress"/>, <bibref ref="microcosm"/>, and <bibref ref="intermedia"/>.</p>
<p>See the XPointer Requirements Document <bibref ref="xpreq"/> for a thorough
explanation of requirements for the design of XPointer.</p>
</div2>
<div2>
<head>Notation and Document Conventions
</head>
<p><termdef id="dt-must" term="Must, May, etc.">The key words 
<term>must</term>, <term>must
not</term>, <term>required</term>, <term>shall</term>, <term>shall 
not</term>, <term>should</term>, <term>should
not</term>, <term>recommended</term>, <term>may</term>, and 
<term>optional</term>
in this specification are to be interpreted as described in <bibref ref="rfc2119"/>.</termdef></p>
<p>The formal grammar for XPointer is given using a simple Extended Backus-Naur
Form (EBNF) notation, as described in the XML Recommendation <bibref ref="XML"/>.
The circumflex (<code>^</code>) metacharacter used in this notation (to denote
the complement of a set of characters) is not to be confused with the 
circumflex
used to escape parenthesis characters in an XPointer.</p>
<p>The prototypes for XPointer functions are given using the same notation
used in the <bibref ref="XPath"/> Recommendation.</p>
<p>This specification contains some explanatory text on the XPath language;
however, such text is non-normative. In the case of conflicts, 
<bibref ref="XPath"/>
is normative.</p>
</div2>
</div1>
<div1>
<head>XPointer Terms and Concepts
</head>
<p>Some special terms are defined here in order to clarify their relationship
to similar terms used in the technologies on which XPointer is based. 
Additional
XPointer-specific terms are defined in the flow of the text. Refer to <bibref ref="XPath"/>, <bibref ref="dom2"/>, <bibref ref="infoset"/>, and <bibref ref="rfc2396"/> for definitions of other technical terms used in this 
specification.</p>
<glist>
<gitem><label>point</label>
<def>
<p>A position in XML information. This notion is defined fully later
(see <termref def="dt-point">point</termref>), and
comes from the DOM Level 2 <bibref ref="dom2"/> specification's notion of positions; this specification refers
to DOM positions by the term <quote>point</quote> to avoid confusion with
XPath positions.</p>
</def></gitem>
<gitem><label>range</label>
<def>
<p>An identification of all the XML information between a pair of points.
This notion is defined fully later (see <termref def="dt-range">range</termref>), and comes from the DOM Level 2 
<bibref ref="dom2"/> specification.</p>
</def></gitem>
<gitem><label><termdef id="dt-location" term="Location">location</termdef></label>
<def>
<p>A generalization of XPath's <term>node</term> that includes points and
ranges in addition to nodes.</p>
</def></gitem>
<gitem><label><termdef id="dt-locset" term="Location 
set">location-set</termdef></label>
<def>
<p>An unordered list of locations, such as produced by an XPointer expression.
This corresponds to the <term>node-set</term> that is produced by 
XPath expressions,
except for the generalization to include points and ranges. Just as for a
node-set, a location-set is treated as having a specific order depending on
the axis that is operating on it. However, this ordering depends on XPointer's
extended notion of document order as defined in <specref ref="document-order-sec"/>,
rather than XPath's original notion of document order.</p>
</def></gitem>
<gitem><label><termdef id="dt-subresource" term="Sub-Resource">sub-resource</termdef></label>
<def>
<p>The portion of an XML resource that is identified by an XPointer. 
For example,
the whole resource being referred to is an XML document or external parsed
entity, but a sub-resource might be a particular element or other location
inside the document
or entity. Following a link to such a sub-resource might result, for example,
in highlighting or scrolling to that location in the document.</p>
</def></gitem>
</glist>
</div1>
<div1 id="conformance">
<head>XPointer Processing and Conformance
</head>
<p>This section details processing and conformance requirements on XPointers,
the fragment identifiers that are based on them, and the applications that
create and process them.</p>

<!-- @@ Add final namespace URI here -->
<p>Should need arise to refer to the namespace for objects defined by 
this specification,
the normative namespace URI is http://www.w3.org/2001/05/XPointer</p>
<div2>
<head>Processing Dependencies
</head>
<p>XPointer processing depends on <bibref ref="rfc2396"/> (as updated 
by <bibref ref="rfc2732"/>) processing. Fully conformant XPointer processing depends
on <bibref ref="XPath"/> processing.</p>
</div2>
<div2>
<head>String Conformance
</head>
<p>A string conforms to the XPointer specification if it adheres to 
the syntactic
requirements and validity constraints imposed by this specification 
(including <bibref ref="XPath"/>, whose requirements are imposed by reference). This specification
does not require that the string, in association with a URI, actually point
to a resource or sub-resource that exists at any given moment.</p>
</div2>
<div2 id="app-conformance">
<head>Application Conformance
</head>
<p><termdef id="dt-xptr-processor" term="XPointer Processor">Given a resource
and an XPointer, an <term>XPointer processor</term> yields the subresource
identified by the XPointer, expressed as a location-set, or else an error
as described in <specref ref="errors"/>.</termdef> This specification defines
two levels of conformance of XPointer processors:</p>
<ulist>
<item><p><termdef id="dt-minimal-conf" term="Minimal Conformance">An XPointer
processor achieves <term>minimal conformance</term> if it handles a series
of <termref def="dt-xptrpart">XPointer parts</termref>, routing XPointer parts
with particular schemes to an application that can evaluate those parts and
skipping over schemes that are not understood as defined in <specref ref="schemes"/>; and handles interpretation of bare-name XPointers, 
as prescribed
in <specref ref="bare-names"/></termdef>.</p></item>
<item><p><termdef id="dt-full-conf" term="Full Conformance">An 
XPointer processor
achieves <term>full conformance</term> if (in addition to the items included in
minimal conformance) it handles interpretation of child-sequence XPointers
and full-form XPointer parts that use the <code>xpointer</code> and 
<code>xmlns</code>
schemes, as prescribed by this specification.</termdef></p></item>
</ulist>
<p>For applications that recognize and interpret XPointers in URI references
that locate resources whose Internet media type is &media-types;, 
full conformance
is required. The minimal conformance level is defined for the convenience
of XML-based Internet media types <bibref ref="draft-xmlmediatypes"/> that
choose to define fragment identifier languages based on XPointer.</p>
</div2>
<div2 id="errors">
<head>Classes of XPointer Errors
</head>
<p>The use of XPointers can give rise to several kinds of errors:</p>
<ulist>
<item><p><termdef id="dt-syntax-err" term="Syntax error">If the string passed
to the XPointer processor does not match the syntax specified in this document,
the processor yields a <term>syntax error</term>.</termdef></p></item>
<item><p><termdef id="dt-rsc-err" term="Resource error">Otherwise, if the
resource passed to the processor is not a well-formed XML document entity
or properly formed external parsed entity according to <bibref ref="XML"/>,
the processor yields a <term>resource error</term>.</termdef></p></item>
<item><p><termdef id="dt-sub-rsc-err" term=" Sub-resource error">Otherwise,
the processor attempts to evaluate the XPointer with respect to the resource,
as described in <specref ref="model"/>. If the evaluation fails as discussed
in <specref ref="schemes"/>, the processor yields a 
<term>sub-resource error</term>.</termdef>
Note that XPath allows expressions that return empty node-sets as their results
and does not regard this situation as an error. Because the XPointer language
is intended as a specification of locations rather than a broader
query language, an empty result is an error.</p></item>
</ulist>
<p>This specification does not constrain how applications deal with resource
errors and sub-resource errors.</p>
</div2>
</div1>
<div1 id="model">
<head>XPointer Model and Language
</head>
<p>XPath expressions work with a data set that is derived from the elements
and other markup constructs of an XML document. The XPointer model augments
this data set. Both XPointers and XPath expressions operate by 
selecting portions
of such data sets, often by their structural relationship to other parts (for
example, the parent of a node with a certain ID value). XPointers use iterative
selections, each operating on what is found by the prior one.</p>
<p>Selection of portions of the information hierarchy is done through axes,
predicates, and functions. An axis defines a sequence of candidates that might
be located; predicates then test for various criteria relative to 
such portions;
and functions generate new candidates or perform various other tasks. For
example, one can select certain elements from among the siblings of 
some previously
located element, based on whether those sibling elements have an attribute
with a certain value, or are of a certain type such as <quote>footnote</quote>;
or select the point location immediately preceding a certain 
<quote>para</quote>.</p>
<div2 id="escaping">
<head>Character Escaping
</head>
<p>The XPointer language is designed to be used in the context of URI 
references,
which require encoding and escaping of certain characters. XPointers (in URI
references) also often appear in XML documents and external parsed 
entities, which impose some escaping
requirements of their own when the encoding limits the repertoire
that can be used directly. Also, because some characters are significant
to XPointer processing, escaping is needed to use these characters in their
ordinary sense. The following sections describe the escaping necessary for
these contexts.</p>
<div3 id="escaping-model">
<head>Escaping Contexts
</head>
<p>The following contexts require various types of escaping to be applied
to XPointers.</p>
<glist>
<gitem><label>A. Escaping of XPointer-significant characters</label>
<def>
<p>An XPointer might need to
contain characters that are significant in the XPointer syntax 
itself. Parentheses
are significant to the XPointer language, so unbalanced parentheses <termref def="dt-must">must</termref> be escaped. Because the circumflex 
(<code>^</code>)
is used to escape such parentheses, literal circumflexes <termref def="dt-must">must</termref>
be escaped as described in <specref ref="xptr-forms"/>.</p>
</def></gitem>
<gitem><label>B. Escaping of reserved URI characters</label>
<def>
<p><termdef id="dt-iuri" term="Internationalized URI reference">An 
<term>internationalized
URI reference</term>, or IURI <bibref ref="iuri"/>, is a URI reference that
directly uses Unicode characters <bibref ref="unicode"/>.</termdef> 
IURI references
allow a superset of the characters of fully escaped URI references, 
but both <termref def="dt-must">must</termref> have normal occurrences of the percent 
sign (<code>%</code>)
escaped because it is the character used for escaping in URIs and IURIs. Thus,
when an XPointer is inserted into a URI reference or IURI reference, 
any occurrences
of percent signs (<code>%</code>) are replaced with <code>%25</code>.</p>
</def></gitem>
<gitem><label>C. Converting IURI references to URI references</label>
<def>
<p>When an IURI reference containing an XPointer (perhaps in an
XML document) is ultimately converted to a fully escaped URI reference that
is suitable for resolution, any remaining characters not allowed in 
URI references <termref def="dt-must">must</termref> be escaped using the process described in <specref ref="uri-escaping"/>. This process can safely be applied repeatedly to fully
escaped URI references in XML documents.</p>
<p>Square brackets (<code>[</code> and <code>]</code>) <termref def="dt-must">should</termref>
be replaced with <code>%5B</code> and <code>%5D</code> respectively, 
for compatibility
with applications that have not implemented the <bibref ref="rfc2732"/> update
to <bibref ref="rfc2396"/>.</p>
</def></gitem>
<gitem><label>D. XML escaping</label>
<def>
<p>If an XPointer appears in a URI reference or IURI reference in an 
XML document
or external parsed entity,
any characters not expressible in the encoding used <termref def="dt-must">must</termref> be escaped as character references, and 
any characters
that are significant to XML processing <termref def="dt-must">must</termref>
be escaped as character references or as predefined entity references. This
escaping is replaced when the XML document or entity is parsed.</p>
</def></gitem>
</glist>
<p>The XPointer-processor handles undoing A. All other escaping is
undone (in reverse order of application) outside the processor. If the
result passed to the processor does not conform
to the syntactic rules for XPointers in this
specification, a <termref def="dt-syntax-err">syntax error</termref> 
results.</p>
</div3>
<div3 id="uri-escaping">
<head>URI Reference Encoding and Escaping
</head>
<p>The set of characters for XPointers is necessarily the same as for XML,
namely <bibref ref="unicode"/>. However, some Unicode characters are disallowed
from URI references. Thus, the disallowed characters in XPointer-containing
URI references <termref def="dt-must">must</termref> ultimately be encoded
and escaped in order for URI resolver software to be able to handle them.</p>
<p>The disallowed characters include all non-ASCII characters, plus 
the excluded
characters listed in Section 2.4 of <bibref ref="rfc2396"/>, except for the
number sign (#) and percent sign (%) and the square bracket 
characters re-allowed
in <bibref ref="rfc2732"/>. Disallowed characters are escaped as follows:</p>
<olist>
<item><p>Each disallowed character is converted to UTF-8 <bibref ref="rfc2279"/>
as one or more bytes.</p></item>
<item><p>Any bytes corresponding to a disallowed character are escaped with
the URI escaping mechanism (that is, converted to <code>%</code><var>HH</var>,
where HH is the hexadecimal notation of the byte value).</p></item>
<item><p>The original character is replaced by the resulting 
character sequence.</p>
</item>
</olist>
</div3>
<div3>
<head>Examples of Escaping
</head>
<p>The following table shows the progressive escaping of an XPointer containing
circumflexes, double quotation marks, and spaces so that it can appear
in an XML document.</p>
<table border="1" frame="border"><thead><tr><th>Context</th><th>Notation</th>
</tr></thead><tbody><tr><td>Initial</td><td>The desired XPointer as it was
initially created:<eg>xpointer(string-range(//P,"a little hat ^"))</eg></td>
</tr><tr><td>A. XPointer</td><td>With the circumflex escaped, as required
by this specification:<eg>doc.xml#xpointer(string-range(//P,"a little 
hat ^^"))</eg></td>
</tr><tr><td>B. IURI reference</td><td>Same as A (no percent sign found that
needs escaping):<eg>doc.xml#xpointer(string-range(//P,"a little hat 
^^"))</eg></td>
</tr><tr><td>C. XML document</td><td>Double quotation marks escaped using
XML's predefined <code>&amp;quot;</code> entity reference (assuming that the
XPointer appears in an attribute value delimited by double quotation 
marks):<eg>doc.xml#xpointer(string-range(//P,&amp;quot;a little hat 
^^&amp;quot;))</eg></td></tr><tr><td>D. URI reference</td><td>With occurrences of the double
quotatation marks (<code>%22</code>), spaces (<code>%20</code>), and 
circumflexes
(<code>%5E</code>) 
escaped:<eg>doc.xml#xpointer(string-range(//P,%22a%20little%20hat%20%5E%5E%22))</eg></td>
</tr></tbody></table>
<p>The following table shows the progressive escaping of an XPointer containing
accented characters. The XPointer is intended to appear in an XML document
encoded in <code>US-ASCII</code>, which does not allow the letter 
<quote>&#xe9;</quote>
to appear directly.</p>
<table border="1" frame="border"><thead><tr><th>Context</th><th>Notation</th>
</tr></thead><tbody><tr><td>Initial</td><td>The desired XPointer as it was
initially created:<eg>xpointer(id('r&#xe9;sum&#xe9;'))</eg></td></tr><tr><td>A. 
XPointer</td>
<td>Same (no circumflex or unbalanced parenthesis found that needs 
escaping):<eg>xpointer(id('r&#xe9;sum&#xe9;'))</eg></td>
</tr><tr><td>B. IURI reference</td><td>Same as A (no percent sign found that
needs escaping):<eg>doc.xml#xpointer(id('r&#xe9;sum&#xe9;'))</eg></td></tr><tr><td>C.
XML document</td><td>Represented in the <code>US-ASCII</code> 
encoding; accented
letters are escaped with XML character 
references:<eg>doc.xml#xpointer(id('r&amp;#xE9;sum&amp;#xE9;'))</eg></td>
</tr><tr><td>D. URI reference</td><td>With occurrences of the letter 
<quote>&#xe9;</quote>
(<code>%C3%A9</code>) 
escaped:<eg>doc.xml#xpointer(id('r%C3%A9sum%C3%A9'))</eg></td>
</tr></tbody></table></div3>
</div2>
<div2 id="xptr-forms">
<head>Forms of XPointer
</head>
<p>This specification defines one full form of XPointer addressing and two
shorthand forms. The shorthand forms are defined as abbreviations of the full
form, although applications need not convert an abbreviated form into the
full form before evaluation. All error conditions apply as if the full form
of the XPointer were specified.</p>
<p>The full form is described in <specref ref="full-form"/>. The two short
forms are bare names (<xnt href="&XML;#NT-Name">Name</xnt>, described 
in <specref ref="bare-names"/>) and child sequences (<nt def="NT-ChildSeq">ChildSeq</nt>,
described in <specref ref="child-seqs"/>). Thus, XPointer offers the following
overall options.</p>
<scrap>
<head>XPointer Forms
</head>
<prod id="NT-XPointer">
<lhs>XPointer</lhs><rhs><xnt href="&XML;#NT-Name">Name</xnt></rhs>
<rhs>| <nt def="NT-ChildSeq">ChildSeq</nt></rhs>
<rhs>| <nt def="NT-FullXPtr">FullXPtr</nt></rhs>
</prod>
</scrap>
<p>The internal structure of an XPointer is as follows.</p>
<scrap>
<head>Internal Structure of XPointer
</head>
<prod id="NT-ChildSeq">
<lhs>ChildSeq</lhs><rhs><xnt href="&XML;#NT-Name">Name</xnt>? ('/' [1-9] [0-9]*
)+</rhs>
</prod>
<prod id="NT-FullXPtr">
<lhs>FullXPtr</lhs><rhs><nt def="NT-XPtrPart">XPtrPart</nt> (<xnt href="&XML;#NT-S">S</xnt>? <nt def="NT-XPtrPart">XPtrPart</nt>)*</rhs>
</prod>
<prod id="NT-XPtrPart">
<lhs>XPtrPart</lhs><rhs> 'xpointer' '(' <nt def="NT-XPtrExpr">XPtrExpr</nt>
')'</rhs>
<rhs>| 'xmlns' '(' <nt def="NT-XPtrNsDecl">XPtrNsDecl</nt>? ')'</rhs>
<rhs>| <nt def="NT-Scheme">Scheme</nt> '(' <nt def="NT-SchemeSpecificExpr">SchemeSpecificExpr</nt>
')'</rhs>
</prod>
<prod id="NT-Scheme">
<lhs>Scheme</lhs><rhs><xnt href="&XMLNames;/#NT-NCName">NCName</xnt></rhs>
</prod>
<prod id="NT-SchemeSpecificExpr">
<lhs>SchemeSpecificExpr</lhs><rhs><nt def="NT-StringWithBalancedParentheses">StringWithBalancedParens</nt></rhs>
</prod>
<prod id="NT-StringWithBalancedParentheses">
<lhs>StringWithBalancedParens</lhs><rhs>[^()]* ('(' <nt def="NT-StringWithBalancedParentheses">StringWithBalancedParens</nt>
')' [^()]*)*</rhs><vc def="circumflex"/>
</prod>
<prod id="NT-XPtrExpr">
<lhs>XPtrExpr</lhs><rhs><xnt href="&XPath;#NT-Expr">Expr</xnt></rhs><vc def="circumflex"/>
</prod>
<prod id="NT-XPtrNsDecl">
<lhs>XPtrNsDecl</lhs><rhs><xnt href="&XMLNames;/#NT-NCName">NCName</xnt> <xnt href="&XML;#NT-S">S</xnt>? '=' <xnt href="&XML;#NT-S">S</xnt>? <nt def="NT-XPtrNsURI">XPtrNsURI</nt></rhs>
</prod>
<prod id="NT-XPtrNsURI">
<lhs>XPtrNsURI</lhs><rhs><xnt href="http://www.w3.org/TR/REC-xml#NT-Char">Char</xnt>*</rhs>
<vc def="circumflex"/><vc def="Valid-Namespace-Name"/>
</prod>
</scrap>
<vcnote id="circumflex"><head>Parenthesis escaping
</head><p> The end of an
XPointer part is signaled by the right parenthesis 
<quote><code>)</code></quote>
character that is balanced with the left parenthesis 
<quote><code>(</code></quote>
character that began the part. Although the production disallows unbalanced
parenthesis characters, they <termref def="dt-must">may</termref> 
occur. However,
if one does occur, even within literals, it <termref def="dt-must">must</termref>
be escaped with a circumflex (<code>^</code>) character preceding it. If the
expression contains any literal occurrences of the circumflex, each <termref def="dt-must">must</termref> be escaped with an additional circumflex (that
is, <code>^^</code>). Any other use of a circumflex results in a <termref def="dt-syntax-err">syntax error</termref>. </p>
</vcnote>
<vcnote id="Valid-Namespace-Name"><head>Namespace Name
</head><p>The value
of an <nt def="NT-XPtrNsURI">XPtrNsURI</nt> must be a URI reference suitable
for a namespace name.</p>
</vcnote>
<p><xnt href="&XML;#NT-Name">Name</xnt>, <xnt href="&XML;#NT-S">S</xnt>, and <xnt href="http://www.w3.org/TR/REC-xml#NT-Char">Char</xnt> are as defined in the
XML Recommendation <bibref ref="XML"/>; <xnt href="&XMLNames;/#NT-QName">NCName</xnt>
is as defined in the Namespaces in XML Recommendation <bibref ref="XML-Names"/>;
and <xnt href="&XPath;#NT-Expr">Expr</xnt> is as defined in the XPath 
Recommendation <bibref ref="XPath"/>, with the XPointer extensions defined in this specification.</p>
<div3 id="full-form">
<head>Full XPointers
</head>
<p>The full form of addressing consists of one or more <termdef id="dt-xptrpart" term="XPointer Part"><term>XPointer parts</term>; each starts with a scheme
name and is followed by a parenthesized expression, and multiple parts are
optionally separated by white space.</termdef> When the scheme is 
<code>xpointer</code>
(see <specref ref="schemes"/> for more information), the associated expression
provides access to nodes and non-node locations in an XML document's or
external parsed entity's data set.</p>
</div3>
<div3 id="bare-names">
<head>Bare Names
</head>
<p>A bare name stands for the same name provided as the argument of 
<code>id()</code>. For example, the first XPointer
below is the bare-name equivalent of the second, which uses the full XPointer
form:</p>
<eg>intro
xpointer(id("intro"))</eg>
<p>The bare-name shorthand is provided for two reasons:</p>
<ulist>
<item><p>To encourage use of IDs, which are the form of addressing most likely
to survive document change. (See <bibref ref="xpreq"/> and <bibref ref="rlocs"/>
for more information on creating robust addresses into resources.)</p></item>
<item><p>To provide an analog of the HTML fragment identifier behavior for
resources with XML media types. (Note that the XHTML specification 
<bibref ref="xhtml"/> defines
some guidelines for anchors that help the bare-name shorthand to work 
in concert
with the HTML fragment identifier in cases of content negotiation.)</p></item>
</ulist>
</div3>
<div3 id="child-seqs">
<head>Child Sequences
</head>
<p>A child sequence locates an element by stepwise navigation using a sequence
of integers separated by slashes (/). Each integer <var>n</var> 
locates the <var>n</var>th
child element of the previously located element, equivalent to an 
XPath location
step of the form <code>*[</code><var>n</var><code>]</code>. If the 
resource passed to the Xpointer-processor is a document, the
first integer in the sequence will be 1, and it locates the document
element; if the resource is an external parsed entity, the first
integer locates one of the top-level elements.</p>
<p>A child sequence can optionally begin with a name before the integers;
the name locates an element as described for bare names in <specref ref="bare-names"/>.
For example, the following two XPointers would locate the same XML information,
assuming <code>intro</code> is the ID attribute value of the element that
is the fifth child of the second child of the document element:</p>
<eg>intro/14/3
/1/2/5/14/3</eg>
</div3>
</div2>
<div2 id="schemes">
<head>Schemes
</head>
<p>Each <nt def="NT-XPtrPart">XPtrPart</nt> begins with a <nt def="NT-Scheme">Scheme</nt>
that identifies the particular notation used for that <nt def="NT-XPtrPart">XPtrPart</nt>.
This specification defines only two schemes, <code>xpointer</code> 
and <code>xmlns</code>.
When an XPointer is the fragment identifier of an IURI and the scheme 
name for an
XPointer part is not recognized, that XPointer part fails and 
processing continues with
the next XPointer part (if any).
The scheme mechanism provides a general framework for extensibility
that can be used for future versions of XPointer, or for other media types
that wish to adopt all or part of this specification in defining their own
fragment identifier languages. It is <termref def="dt-must">recommended</termref>
that if XML-based media types governed by <bibref ref="draft-xmlmediatypes"/>
define any XPointer-style scheme names, the names beginning with 
<quote>xpointer</quote>
and <quote>xmlns</quote> be avoided until they can be formally reserved.</p>
<p>For example, an XML-based vocabulary that is registered to have 
the <code>image/4Dgrafix+xml</code>
media type might choose to adopt the XPointer scheme mechanism and define
its own <code>4Dgrafix-xml</code> scheme instead of, or in addition 
to, the <code>xpointer</code>
scheme. It is particularly useful for XML-based media types to incorporate
XPointer by reference so that, in the case of content negotiation, a client
that does not support the specific XML-based media type can fall back 
on the <code>xpointer</code>
scheme if one is provided. The provision for <termref def="dt-full-conf">full
conformance</termref> is defined in <specref ref="app-conformance"/> to this
end. Alternatively, XML-based media types can incorporate XPointer's notion
of <termref def="dt-minimal-conf">minimal conformance</termref> so that the
scheme framework can be used, even without interpretation of the 
<code>xpointer</code>
or <code>xmlns</code> scheme.</p>
<p>Minimal conformance requires the following handling. When multiple <nt def="NT-XPtrPart">XPtrPart</nt>s are provided, they <termref def="dt-must">must</termref>
be evaluated in left-to-right order. If a part being evaluated fails for one
of the following reasons, the next is evaluated:</p>
<ulist>
<item><p>An unknown scheme.</p></item>
<item><p>A scheme that is not applicable to the media type of the resource.</p>
</item>
<item><p>A n XPointer part that does not locate any sub-resource 
present in the resource (such as
an XPtrPart that returns an empty location set).</p>
<p>Note that an XPointer part that uses <code>xmlns</code> scheme never returns
a sub-resource and thus always fails. However, its evaluation has a potential
effect on XPointer parts to its right; see <specref ref="ns-context"/> for
more information.</p></item>
</ulist>

<p>The XPointer application <termref def="dt-must">must</termref> consume
a failed XPointer part and attempt to evaluate the next one, if any. The result
of the first XPointer part whose evaluation succeeds is taken to be 
the sub-resource
located by the XPointer as a whole. If all the parts fail,
the XPointer as a whole has a <termref def="dt-sub-rsc-err">sub-resource error</termref>.
If a <termref def="dt-syntax-err">syntax error</termref> is detected in any
part or in the construction of the XPointer as a whole, evaluation stops and
additional parts are not consumed.</p>
<p>For example, the following XPointer locates the element with an ID attribute
whose value is <quote>chap1</quote>:</p>
<eg>xpointer(id("chap1"))</eg>
<p>However, in the absence of the DTD, it is not typically possible 
to determine
if an attribute is of type <kw>ID</kw>. An XPointer like the following, with
two parts, will have its first part fail if no DTD is available, but will
have its second part succeed if the desired attribute's <emph>name</emph>
is <code>id</code>; note that the intent of the second XPointer part is just
an approximation of the first.</p>
<eg>xpointer(id("chap1"))xpointer(//*[@id="chap1"])</eg>
</div2>
</div1>
<div1>
<head>XPointer Extensions to XPath
</head>
<p>XPointer extends XPath by adding the following:</p>
<ulist>
<item><p>Two new location types, <code>point</code> and <code>range</code>,
corresponding to DOM positions and ranges, that can appear in location-set
results; also tests (akin to node tests) for these location types.</p></item>
<item><p>A generalization of the XPath concepts of nodes, node types, and
node-sets to the XPointer concepts of <termref def="dt-locset">locations</termref> (which subsume nodes, <termref def="dt-point">points</termref>, and <termref def="dt-range">ranges</termref>),
and corresponding location types and location-sets.</p>
</item>
<item><p>Rules for establishing the XPath evaluation context.</p></item>
<item><p>The functions <function>string-range</function> and 
<function>range-to</function>,
which return the range location type for selections that are not single XML
nodes.</p></item>
<item><p>The functions <function>here</function> and 
<function>origin</function>,
to provide for addressing relative to the location of an XPointer expression
itself, and to the point of origin for hypertext traversal when XPointers
are used in that (very common) application domain.</p></item>
<item><p>The functions <function>start-point</function> and 
<function>end-point</function>,
to address the beginning and ending locations which bound another location
such as a node or range.</p></item>
<item><p>Allowance (as in <bibref ref="XSLT"/>) for the root node to have
multiple child elements, to allow XPointers to address into arbitrary external
parsed entities as well as well-formed documents.</p></item>
<item><p>The functions <function>range</function> and 
<function>range-inside</function>,
to address the covering range of locatino sets.</p></item>
</ulist>
<div2 id="terminology">
<head>XPointer Additions to XPath Terms and Concepts
</head>
<p>XPath provides for locating any subset of the <emph>nodes</emph> in an
XML document or external parsed entities. XPath functionality, such 
as filtering an axis output by predicate,
is generally defined in terms of operations on nodes and node-sets.</p>
<p>XPointer has a requirement to identify document and entity 
portions that are not nodes
in this sense. One example of such a non-node region is an arbitrary user
selection indicated by a drag between two points in a document. The two points
might have different sets of ancestors in the hierarchy, or the region might
form only a small part of a node. For example, a range could be a single letter
or could extend from the middle of one paragraph to the middle of the next,
thus containing only part of the relevant paragraphs and text nodes. Even
though such locations are not nodes, XPointer needs to be able to apply XPath
operations to them as well as to nodes.</p>
<p>To accomplish this, XPointer defines <term>location</term> as a 
generalization
of XPath's <term>node</term>. Every location is either a <termref def="dt-point">point</termref>,
a <termref def="dt-range">range</termref>, or an XPath node. Thus, XPointer
also defines <term>location-set</term> as a generalization of XPath's node-set.
All locations generated by XPath constructs are nodes; XPointer constructs
can also generate points and ranges.</p>
<note>
<p>The order of characters displayed on a computer screen might not reflect
their order in the underlying XML document, for example, when a portion of
a right-to-left language such as Arabic is embedded in a left-to-right language
such as French. For XPointers that identify ranges of strings, the document
order is used, not the display order. Thus, an XPointer for a single range
might be displayed non-contiguously, and conversely a user selection of an
apparent single range might correspond to multiple non-contiguous XPointer
ranges in the underlying document.</p>
</note>
</div2>
<div2 id="context">
<head>Evaluation Context Initialization
</head>
<p>An XPointer is evaluated to yield an object of type location-set. This
evaluation is carried out within a context identical to the XPath evaluation
context, except for the generalization of nodes to locations. 
XPointer applications <termref def="dt-must">must</termref> initialize the evaluation context as described
in this section before evaluating an <nt def="NT-XPtrExpr">XPtrExpr</nt>.
</p>
<p>An XPointer evaluation context contains the following information:</p>
<ulist>
<item><p>A location (the <term>context location</term>), initialized to the
root node of an XML document or external parsed entity.
When the XPointer is a fragment identifier of
a URI reference, the document or external parsed entity is the one 
identified by the URI portion. If
an application uses XPointers in another context than as a URI reference's
fragment identifier, this specification does not constrain how the applicable
document or external parsed entity is chosen.</p></item>
<item><p>A non-zero context position, initialized to 1.</p></item>
<item><p>A non-zero context size, initialized to 1. (At the start, the only
location in the current location list is the context location.)</p></item>
<item><p>A set of variable bindings. No means for initializing these is defined
for XPointer applications. Thus, the set of variable bindings used 
when evaluating
an XPointer is empty, and use of a variable reference in an XPointer results
in a <termref def="dt-syntax-err">syntax error</termref>.</p></item>
<item><p>A library of functions. Only functions defined in XPath or XPointer
can be used in XPointers. An XPointer that uses other functions results in
a <termref def="dt-syntax-err">syntax error</termref>.</p></item>
<item><p>A set of namespace declarations, described in <specref ref="ns-context"/>.</p>
</item>
<item><p>When applicable, properties for the locations that the 
<function>origin</function>
and <function>here</function> functions return.</p>
</item>
</ulist>
<div3 id="ns-context">
<head>Namespace Initialization
</head>
<p>For any XPointer part that uses the <code>xpointer</code> scheme, 
the evaluation
context of that part <termref def="dt-must">must</termref> be initialized
to a set of namespace declarations consisting of a declaration of the 
<code>xml</code>
prefix, bound to the URI <code>http:/www.w3.org/XML/1998/namespace</code>,
plus any namespace declarations specified by <code>xmlns</code> XPointer parts
appearing to its left. Each <code>xmlns</code> part defines a 
namespace declaration
as a prefix (<xnt href="&XMLNames;/#NT-NCName">NCName</xnt>) 
and namespace URI
(<nt def="NT-XPtrNsURI">XPtrNsURI</nt>). In the event 
that two or more <code>xmlns</code>
parts specify the same prefix, the rightmost one is used. Any 
<code>xmlns</code>
parts attempting to override the <code>xml</code> prefix <termref def="dt-must">must</termref>
be ignored.</p>
<p>As an example, assume the following target XML resource:</p>
<eg>&lt;doc>
   &lt;x:a xmlns:x="http://example.com/foo">
     &lt;x:a xmlns:x="http://example.org/bar">This element and
     its parent are in different namespaces.&lt;/x:a>
   &lt;/x:a>
&lt;/doc></eg>
<p>Evaluation of the following XPointer
will fail; it cannot be known which <el>a</el> element is desired because
no namespace declarations are in scope:</p>
<eg>xpointer(//x:a)</eg>
<p>The following avoids this evaluation failure and ensures that the 
outer <el>a</el>
element is addressed:</p>
<eg>xmlns(x=http://example.com/foo) xpointer(//x:a)</eg>
<p>The following (printed on two lines for convenience) allows for accurate
addressing of the inner <el>a</el> element; note that the prefix used inside
the XPointer need not correspond to the prefix (if any) actually used in the
target resource:</p>
<eg>xmlns(x=http://example.com/foo) xmlns(y=http://example.org/bar)
xpointer(//x:a/y:a)</eg>
</div3>
</div2>
<div2 id="datatypes">
<head>The <code>point</code> and <code>range</code> Location Types
</head>
<p>To address non-node locations, XPointer defines two new location 
types, <code>point</code>
and <code>range</code>, that can appear in location-sets and can be operated
on by XPath node tests and predicates. Locations of the <code>point</code>
and <code>range</code> type represent positions and ranges as in DOM Level
2 <bibref ref="dom2"/>. This section defines the <code>point</code> 
and <code>range</code>
types and their characteristics required for XPath interoperability.</p>
<note>
<p>Unlike DOM Level 2, which is based on UTF-16 units, XPath and XPointer
are based on UCS characters. So while the concepts of points and ranges are
based on the DOM 2 notions of positions and ranges, there are differences
in detail. For example, a sequence which in DOM counts as two characters might
count in XPointer as one character.</p>
</note>
<p>Points and ranges can be used as XPointer context locations. This allows
the XPointer <code>[]</code> operator to be used to select from sets of ranges.
Also, a point as a context location, when followed by a 
<function>range-to</function>
function, selects a range.</p>
<div3>
<head>Definition of Point Location
</head>
<p><termdef id="dt-point" term="Point">A
location of type <term>point</term> 
is defined by</termdef> <termdef id="dt-container-node-index" term="Container Node and Index">a node,
called the <term>container node</term>, and a non-negative integer, called
the <term>index</term>.</termdef> It can represent the location 
preceding or following
any individual character, or preceding or following any node in the data set
constructed from an XML document or external parsed entity. Two 
points are identical if they have
the same container node and index.
</p>
<note><p> This specification does not constrain the implementation of 
points; applications
need not actually represent points using data structures consisting of a node
and an index.</p>
<p>Also note that, while some nodes containing points have explicit boundaries
(such as element start-tags and end-tags), the boundaries of text nodes are
implicit. Applications that present a graphical user interface for 
the selection
or rendering of points and ranges need to take into consideration the fact
that some seemingly identical points, such as the points just inside and just
outside the closing boundary of a text node inside an element, are in fact
distinguished.</p>
</note>
<p><termdef id="dt-node-point" term="Node point">When the container node of
a point is of a node type that can have child nodes (that is, when 
the container
node is an element node or a root node), then the index is an index into the
child nodes; such a point is called a <term>node-point</term>.</termdef> The
index of a node-point <termref def="dt-must">must</termref> be greater than
or equal to zero and less than or equal to the number of child nodes of the
container. An index of zero indicates the point before any child nodes, and
a non-zero index <var>n</var> indicates the point immediately after 
the <var>n</var>th
child node.</p>
<note>
<p>The zero-based counting of node-points differs from the one-based counting
of <function>string-range</function> and other XPointer and XPath 
functions.</p>
</note>
<p><termdef id="dt-character-point" term="Character point">When the container
node of a point is of a node type that cannot have child nodes (i.e., text
nodes, comments, processing instructions, attribute nodes, and namespace
nodes), then the index is an index
into the characters of the string-value of the node; such a point is called
a <term>character-point</term>.</termdef> The index of a 
character-point <termref def="dt-must">must</termref> be greater than or equal to zero and less than
or equal to the length of the string-value of the node. An index of 
zero indicates
a point immediately before the first character of the string-value, and a
non-zero index <var>n</var> indicates the point immediately after the 
<var>n</var>th
character of the string-value.</p>
<p>A point location does not have an expanded-name.</p>
<p>The <xtermref href="&XPath;#dt-string-value">string-value</xtermref> of
a point location is empty.</p>
<p> The axes of a point location are defined as follows: </p><ulist>
<item><p>The <kw>child</kw>, <kw>descendant</kw>, 
<kw>preceding-sibling</kw>, <kw>following-sibling</kw>, 
<kw>preceding</kw>, <kw>following</kw>, <kw>attribute</kw>, and <kw>namespace</kw> axes are empty.</p></item>
<item><p>The <kw>descendant-or-self</kw> axis contains the point 
itself.</p></item>
<item><p>The <kw>self</kw> axis contains the point itself.</p></item>
<item><p>The <kw>parent</kw> axis contains the point's container node.</p>
</item>
<item><p>The <kw>ancestor</kw> axis contains the point's container node
and its ancestors.</p></item>
<item><p>The <kw>ancestor-or-self</kw> axis contains the point itself,
the point's container node, and its ancestors.</p></item>
</ulist>
</div3>
<div3>
<head>Definition of Range Location
</head>
<p>A location of type <termdef id="dt-range" term="Range">range</termdef> is defined by
two points, a start point and an end point. A range represents all of the
XML structure and content between the start point and end point. This 
is distinct
from any list of nodes and/or characters, in part because some nodes might
be only partly included. The start point and end point of a range 
<termref def="dt-must">must</termref>
be in the same document or external parsed entity. The start point 
<termref def="dt-must">must</termref>
not appear after the end point in document order (see <specref ref="document-order-sec"/>).</p>
<p><termdef id="dt-collapsed-range" term="Collapsed range">A range 
whose start point
and end point are equal is a <term>collapsed range.</term></termdef></p>
<p>If the container node of one point of a range is a node of a type other
than element, text, or root, the container node of the other point of the
range <termref def="dt-must">must</termref> be the same node. For example,
it is allowed to specify a range from the start of a processing instruction
to the end of an element, but not to specify a range from text inside 
a processing
instruction to text outside it.</p>
<p>A range location does not have an expanded-name.</p>
<p>The <xtermref href="&XPath;#dt-string-value">string-value</xtermref> of
a range location consists of the characters that are in text nodes and that are
between the start point and end point of the range.</p>
<p>The axes of a range location are identical to the axes of its start point.
For example, the <kw>parent</kw> axis of a range contains the parent of the
start point of the range.</p>
<note>
<p>The <function>start-point</function> and <function>end-point</function>
functions can be used to navigate with respect to the boundaries
of a range location.</p>
</note>
</div3>
<div3>
<head>Covering Ranges for All Location Types
</head>
<p><termdef id="dt-covering-range" term="Covering range">A <term>covering
range</term> is a range that wholly encompasses a location. For every location,
a covering range is defined as follows:</termdef></p>
<ulist>
<item><p>For a range location, the covering range is identical to the 
range.</p>
</item>
<item><p>For a point location, the start and end points of the covering range
are the point itself.</p></item>
<item><p>For an attribute or namespace location, the container node of the
start point and end point of the covering range is the attribute or namespace
location; the index of the start point of the covering range is 0; and the
index of the end point of the covering range is the length of the string-value
of the attribute or namespace location.</p></item>
<item><p>For the root location, the container node of the start point and
end point of the covering range is the root node; the index of the start point
of the covering range is 0; and the index of the end point of the covering
range is the number of children of the root location.</p></item>
<item><p>For any other kind of location, the container node of the start point
and end point of the covering range is the parent of the location; the index
of the start point of the covering range is the number of preceding sibling
nodes of the location; and the index of the end point is one greater than
the index of the start point.</p></item>
</ulist>
</div3>
<div3>
<head>Tests for <code>point</code> and <code>range</code> Locations
</head>
<p>XPointer extends the XPath production for <xnt href="&XPath;#NT-NodeType">NodeType...</xnt>
by adding items for the <code>point</code> and <code>range</code> location
types. The production (number 38 in XPath) becomes as follows:</p><scrap>
<head>NodeType
</head>
<prod id="NT-NodeType">
<lhs>NodeType</lhs><rhs>'comment'</rhs>
<rhs>| 'text'</rhs>
<rhs>| 'processing-instruction'</rhs>
<rhs>| 'node'</rhs>
<rhs>| 'point'</rhs>
<rhs>| 'range'</rhs>
</prod>
</scrap>
<p>This definition allows <xnt href="&XPath;#NT-NodeTest">NodeTest</xnt>s
to select locations of type <code>point</code> and <code>range</code> from
a location-set that might include locations of many types.</p>
</div3>
<div3 id="document-order-sec">
<head id="documentorder">Document Order
</head>
<p>XPointer extends XPath's concept of <term>document order</term> to cover
point and range locations. The concept applies equally in external 
parsed entities.</p>

<p>A point can be either a node point or a character point. Conceptually,
node points label gaps between nodes, while character points occur 
within a node,
between the node points to the right and left of the node.</p>

<p>Thus, an element P has a node point before and after it. If the P 
element contains sub-elements
and/or text nodes, there are node points for the gap before the first 
child node, between each successive pair of child
nodes, and after the last child node; they are numbered in order from 0.</p>
<p>WIthin any text node, there are character points preceding the first
character of the text, between each successive pair of characters, as 
well as after the last character; they are numbered in order from 
0.</p>

<p>For any point, there is an <termdef id="dt-immed-prec" term="immediately preceding node">immediately preceding 
node</termdef> defined as follows
(except that there is no point defined preceding or following the root):</p>
<ulist>
<item>
<p>For a <termref def="dt-node-point">node-point</termref> with a non-zero
index <var>n</var>, the immediately
preceding node is the <var>n</var>th child of the node-point's container
node.</p></item>
<item>
<p>For a node-point with a zero index, the immediately preceding node 
is the <termref def="dt-container-node-index">container
node</termref> unless it has any attribute
or namespace nodes. If the container node does have attribute or namespace
nodes, then the immediately preceding node is the last of those attribute
or namespace nodes (note that the order of attribute and namespace nodes
is implementation-dependent).</p>
</item>
<item>
<p>For a <termref def="dt-character-point">character-point</termref>,
the immediately preceding node is the container node of the 
character-point.</p>
</item>
</ulist>
<p>The following diagram illustrates the relation between <termref def="dt-container-node-index">container
nodes</termref>, <termref def="dt-node-point">node-points</termref> and <termref def="dt-character-point">character-points</termref>.</p>
<graphic alt="Tree-structured diagram of XML document fragment, illustrating character and node points" source="XPointer_diagram.png"/>
<!-- broken into list per issue XP125, sjd 5/6/01 -->

<p>The document order of locations is specified here according to the 
location types
to be compared:</p>

<glist>
<gitem><label>Node and node</label>
<def><p>As defined by XPath.</p></def></gitem>

<gitem><label>Node and point</label>
<def><p>A node and point can never be equal in document order.
A node is before a point if the node is before or equal in document order
to the immediately preceding node of the point; otherwise, the node is after
the point.</p></def></gitem>

<gitem><label>Node and range</label>
<def><p>A node and range can never be equal in document order.
A node is before a range if the node is before
the start point of the range; otherwise the node is after the 
range.</p></def></gitem>

<gitem><label>Point and point</label>
<def><p>
Two points P1 and P2 are equal if their immediately preceding nodes are equal
and the indexes of the points are equal.
P1 is before P2 if P1's immediately preceding node is before P2's, or
if their immediately preceding nodes are equal and P1's index is less 
than P2's.
Otherwise P2 is after P1.</p></def></gitem>

<gitem><label>Point and range</label>
<def><p>
A point P is equal to a range R if R's start and end points are both 
equal to P;
otherwise P is before R if P is before or equal to the start point of R;
otherwise P is after R.</p></def></gitem>

<gitem><label>Range and range</label>
<def><p>Two ranges R1 and R2 are equal in document order if their 
start points are equal
and their end points are equal.
R1 is before R2 if R1's start point is before R2's start point or if
R1's start point is equal to R2's and R1's end point is before 
R2's; otherwise R2 is after R1.</p></def></gitem>

</glist>

<p>Note that one consequence of these rules is that a point can be 
treated the same as
the equivalent collapsed range.</p>

</div3>
</div2>
<div2 id="xptr-functions">
<head>XPointer Functions
</head>
<p>XPointer adds the following functions to those in XPath; these 
functions <termref def="dt-must">must</termref> be provided by XPointer applications.</p>
<div3 id="rangeexprs">
<head><function>range-to</function> Function
</head>
<proto name="range-to" return-type="location-set"><arg type="location-set"/>
</proto>
<p>For each location in the context, <function>range-to</function> returns
a range. The start point of the range is the start point of the 
context location
(as determined by the <function>start-point</function> function),
and the end point of the range is the end point
(as determined by the <function>end-point</function> function)
of the location found by evaluating
the <xnt href="&XPath;#NT-Expr">expression</xnt> argument with respect to
that context location.</p>
<p>The change made to the XPath syntax to support the 
<function>range-to</function>
construct corresponds to a single addition to the <xspecref href="http://www.w3.org/TR/xpath#section-Location-Steps">Step
production</xspecref> of the <bibref ref="XPath"/> specification. The original
production is as follows:</p>
<eg>[4] Step ::= AxisSpecifier NodeTest Predicate*
                | AbbreviatedStep</eg>
<p>The XPointer version is as follows:</p>
<eg>[4xptr] Step ::= AxisSpecifier NodeTest Predicate*
                    | AbbreviatedStep
                    | 'range-to' '(' Expr ')' Predicate*</eg>
<p>This change is a single exception for the <function>range-to</function>
function. It is not a generic change and is not extensible to other functions.
The modified production expresses that a range computation must be made for
each of the locations in the current location list.</p>
<p>As an example of using the <function>range-to</function> function, the
following XPointer locates the range from the start point of the element
with ID <quote>chap1</quote> to the end point of the element with ID 
<quote>chap2</quote>.</p>
<eg>xpointer(id("chap1")/range-to(id("chap2")))</eg>
<p>As another example, imagine a document that uses empty elements 
(such as <code>&lt;REVST/></code>
for revision start and <code>&lt;REVEND/></code> for revision end) to mark
the boundaries of edits. The following XPointer would select, for 
each revision,
a range starting at the beginning of the <code>REVST</code> element and ending
at the end of the next <code>REVEND</code> element:</p>
<eg>xpointer(descendant::REVST/range-to(following::REVEND[1]))</eg>
</div3>
<div3 id="stringrange">
<head><function>string-range</function>() Function
</head>
<proto name="string-range" return-type="location-set"><arg type="location-set"/><arg type="string"/><arg type="number" occur="opt"/><arg type="number" occur="opt"/>
</proto>
<p>For each location in the <var>location-set</var> argument,
<function>string-range</function>
returns a set of ranges determined by searching the <xtermref href="&XPath;#dt-string-value">string-value</xtermref> of the location
for substrings that match the <var>string</var> argument.
An empty string is defined to match before each character of the
string-value and after the final character.White space in a string is matched
literally, with no normalization except that provided by XML for line ends
and attribute values. Each non-overlapping
match can contribute a range to the resulting location set. </p>

<p>The third argument gives the position of the first character
to be in the resulting range, relative to the start of the match. The default
value is 1, which makes the range start immediately before the first character
of the matched string. The fourth argument gives the number of characters
in the range; the default is that the range extends to the end of the matched
string. Thus, both the start point and end point of each range returned by the
<function>string-range</function> function will be
<termref def="dt-character-point">character points</termref>.</p>

<p>Element boundaries, as well as entire embedded nodes such as processing
instructions and comments, are ignored as specified by the definition 
of <xtermref href="&XPath;#dt-string-value">string-value</xtermref> in <bibref ref="XPath"/>.</p>
<p>For any particular match,
if the <var>string</var> argument is not found in the string-value of the
location, or if the third and fourth argument indicates a range that is wholly
beyond the beginning or end of the document or entity, then no range is
added to the result for that match.</p>
<p>The start and end points of the range-locations in the returned 
location-set will all
be character points.</p>
<p>For example, the following expression returns a range that selects the
17th occurrence of the string <quote>Thomas Pynchon</quote> occurring 
in a <code>title</code>
element:</p>
<eg>string-range(//title,"Thomas Pynchon")[17]</eg>
<p>As another example, the following expression returns a collapsed range
whose points immediately precede the letter <quote>P</quote> (8 from the start
of the string) in the third occurrence of the string <quote>Thomas 
Pynchon</quote>
in a <code>P</code> element:</p>
<eg>string-range(//P,"Thomas Pynchon",8,0)[3]</eg>
<p>Alternatively this could be specified as follows:</p>
<eg>string-range(string-range(//P,"Thomas Pynchon")[3],"P",1,0)</eg>
<p>String-values are <quote>views</quote> into only the string content of
a document or entity; they do not retain the structural context of 
any non-text nodes
interspersed with the text. Because the <function>string-range</function>
function operates on a string-value, markup that intervenes in the middle
of a string does not prevent a match. (Note that for this reason, a 
<function>string-range</function>
match is a range describing the relevant substring of the string-value, not
necessarily a contiguous string in a single text node in the document.) For
example, if the 17th occurrence of <quote>Thomas Pynchon</quote> had some
inline markup in it as follows, it would not change the string returned by
the XPointer application:</p>
<eg>Thomas &lt;em>Pyn&lt;/em>chon</eg>
<p>The following expression selects the fifth exclamation mark in any text
node in the document and the character immediately following it:</p>
<eg>string-range(/,"!",1,2)[5]</eg>
<p>Although these examples locate ranges via text in the string-values of 
elements, <function>string-range</function>
is useful for locating ranges that are wholly enclosed in other node types
as well, such as attributes, processing instructions, and comments.</p>
</div3>
<div3>
<head>Additional Range-Related Functions
</head>
<p>The following functions are related to ranges.</p>
<div4>
<head><function>range</function> Function
</head>
<proto name="range" return-type="location-set"><arg type="location-set"/>
</proto>
<p>The <function>range</function> function returns ranges covering 
the locations
in the argument location-set. For each location <var>x</var> in the argument
location-set, a range location representing the covering range of <var>x</var>
is added to the result location-set.</p>
</div4>
<div4>
<head><function>range-inside</function> Function
</head>
<proto name="range-inside" return-type="location-set"><arg type="location-set"/>
</proto>
<p>The <function>range-inside</function> function returns locations covering
the contents of the locations in the argument location-set. For each 
location <var>x</var>
in the argument location-set, a location is added to the result location-set.
If <var>x</var> is a range location or a point, then <var>x</var> is added
to the result location-set. Otherwise <var>x</var>
is used as the container node of the start and end points of the range location
to be added, which is defined in this way:
The index of the start point of the range is zero. If the end
point is a character point then its index is the length of the string-value
of <var>x</var>; otherwise its index is the number of children of
<var>x</var>.</p>
</div4>
<div4>
<head><function>start-point</function> Function
</head>
<proto name="start-point" return-type="location-set"><arg type="location-set"/>
</proto>
<p>For each location <emph>x</emph> in the argument location-set, 
<function>start-point</function>
adds a location of type point to the resulting location-set. That 
point represents
the start point of location <emph>x</emph> and is determined by the following
rules:</p>
<ulist>
<item><p>If <emph>x</emph> is of type point, the resulting point is 
<emph>x</emph>.</p>
</item>
<item><p>If <emph>x</emph> is of type range, the resulting point is the start
point of <emph>x</emph>.</p></item>
<item><p>If <emph>x</emph> is of type root, element, text, comment, 
or processing
instruction, the container node of the resulting point is 
<emph>x</emph> and the
index is 0.</p></item>
<item><p>If <emph>x</emph> is of type attribute or namespace, the XPointer
part in which the function appears fails.</p></item>
</ulist>
</div4>
<div4>
<head><function>end-point</function> Function
</head>
<proto name="end-point" return-type="location-set"><arg type="location-set"/>
</proto>
<p>For each location <var>x</var> in the argument location-set, 
<function>end-point</function>
adds a location of type point to the result location-set. That point represents
the end point of location <var>x</var> and is determined by the following
rules:</p>
<ulist>
<item><p>If <var>x</var> is of type point, the resulting point is 
<var>x</var>.</p>
</item>
<item><p>If <var>x</var> is of type range, the resulting point is the end
point of <var>x</var>.</p></item>
<item><p>If <var>x</var> is of type root or element, the container node of
the resulting point is <var>x</var> and the index is the number of children
of <var>x</var>.</p></item>
<item><p>If <var>x</var> is of type text, comment, or processing instruction,
the container node of the resulting point is <var>x</var> and the index is
the length of the string-value of x.</p></item>
<item><p>If <emph>x</emph> is of type attribute or namespace, the XPointer
part in which the function appears fails.</p></item>
</ulist>
</div4>
</div3>
<div3>
<head><function>here</function> Function
</head>
<proto name="here" return-type="location-set"></proto>
<p>The <function>here</function> function is meaningful only when the
XPointer being interpreted occurs in an XML document or external parsed
entity; otherwise the XPointer
part in which the <function>here</function> function appears fails.
When in an XML context, the <function>here</function> function
returns a location-set with a single
member. There are two possibilities for the location returned:</p>
<ulist>
<item><p>If the XPointer being evaluated appears in a text node inside an
element node, the location returned is the element node.</p></item>
<item><p>Otherwise, the location returned is the node that directly contains
the XPointer being evaluated.</p></item>
</ulist>
<p>In the following example, the <function>here</function> function appears
inside an XPointer that is in an attribute node. The XPointer as a whole,
then, returns the <el>slide</el> element just preceding the <el>slide</el>
element that most directly contains the attribute node in question.</p>
<eg>&lt;button
   xlink:type="simple"
   xlink:href="#xpointer(here()/ancestor::slide[1]/preceding::slide[1])">
Previous
&lt;/button></eg>
<note>
<p>The type of the node in which the <function>here</function> function appears
is likely to be <code>text</code>, <code>attribute</code>, or 
<code>processing-instruction</code>.
The returned location for an XPointer appearing in element content does not
have a node type of <code>element</code> because the XPointer is in a text
node that is itself inside an element.</p>
</note>
<p></p>
</div3>
<div3>
<head><function>origin</function> Function
</head>
<proto name="origin" return-type="location-set"></proto>
<p>The <code>origin()</code>
function is meaningful only when the XPointer is being
processed in response to traversal of a link expressed in an XML document.
The <function>origin</function> function enables addressing relative to
third-party and inbound links such as defined in <loc href="&XLink;/">XLink</loc>.
This allows XPointers to express relative locations
when links do not reside directly at one of their endpoints. The function
returns a location-set with a single member, which locates the element from
which a user or program initiated traversal of the link.  (See 
<bibref ref="XLink"/> for information about traversal.)</p>
<p>It is a <termref def="dt-rsc-err">resource error</termref> to use 
<function>origin</function>
in the fragment identifier portion of a URI reference where a URI is also
provided and identifies a resource different from the resource
from which traversal was initiated, or in a situation where traversal is not
occurring.</p>
</div3>
</div2>
<div2>
<head>Root Node Children
</head>
<p><bibref ref="XML"/> requires well-formed documents to contain a single
element at the top level. Thus, the XPath data model of a well-formed document
will have a root node with a single child node of type element. In order to
allow XPointer to be used to address locations in arbitrary external parsed
entities, along with well-formed documents, XPointer extends the XPath data
model to allow the root node to have any sequence of nodes as children that
would be possible of an element node. This extension is identical to the one
made by <bibref ref="XSLT"/>. Thus, the root node may contain child nodes
of type text, and any number of child nodes of type element.</p>
</div2>
</div1>
</body><back>
<div1 id="references">
<head>References
</head>
<div2>
<head>Normative References
</head>
<blist>
<bibl id="rfc2119" href="http://www.ietf.org/rfc/rfc2119.txt" key="IETF RFC 2119"><titleref>RFC
2119: Key words for use in RFCs to Indicate Requirement Levels</titleref>.
Internet Engineering Task Force, 1997.</bibl>
<bibl id="rfc2279" href="http://www.ietf.org/rfc/rfc2279.txt" key="IETF RFC 2279"><titleref>RFC
2279: UTF-8, a transformation format of ISO 10646</titleref>. 
Internet Engineering
Task Force, 1998.</bibl>
<bibl id="rfc2396" href="http://www.ietf.org/rfc/rfc2396.txt" key="IETF RFC 2396"><titleref>RFC
2396: Uniform Resource Identifiers</titleref>. Internet Engineering Task Force,
1995.</bibl>
<bibl id="rfc2732" href="http://www.ietf.org/rfc/rfc2732.txt" key="IETF RFC 2732"><titleref>RFC
2732: Format for Literal IPv6 Addresses in URL's</titleref>. Internet 
Engineering
Task Force, 1999.</bibl>
<bibl id="draft-xmlmediatypes" href="http://www.ietf.org/rfc/rfc3023" key="IETF RFC 3023"><titleref>RFC
3023: XML Media Types</titleref>. Internet Engineering Task Force, 2001.</bibl>
<bibl id="dom2" href=" http://www.w3.org/TR/DOM-Level-2-Core/" key="DOM2"><titleref>Document
Object Model (DOM) Level 2 Specification: Version 1.0.</titleref> World Wide
Web Consortium, 2000.</bibl>
<bibl id="unicode" href="http://www.unicode.org/unicode/standard/standard.html" key="Unicode">The Unicode Consortium. <titleref>The Unicode 
Standard.</titleref></bibl>
<bibl id="XML" href="http://www.w3.org/TR/REC-xml" key="XML">Tim Bray, Jean
Paoli, C.M. Sperberg-McQueen, and Eve Maler, editors. <emph>Extensible Markup
Language (XML) 1.0 (Second Edition).</emph> World Wide Web 
Consortium, 2000.</bibl>
<bibl id="XML-Names" xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/REC-xml-names/" key="XML-Names">Tim Bray, Dave Hollander, and Andrew Layman, editors. 
<titleref>Namespaces
in XML</titleref>. World Wide Web Consortium, 1999.</bibl>
<bibl id="XPath" href="http://www.w3.org/TR/xpath" key="XPath">James Clark
and Steve DeRose, editors. <titleref>XML Path Language (XPath)</titleref>.
World Wide Web Consortium, 1999.</bibl>
</blist></div2>
<div2>
<head>Non-Normative References
</head>
<blist>
<bibl id="chum" key="CHUM">Steven J. DeRose and David G. Durand. 
1995. <quote>The
TEI Hypertext Guidelines.</quote> In <titleref>Computing and the 
Humanities</titleref>
29(3). Reprinted in <titleref>Text Encoding Initiative: Background 
and Context</titleref>,
ed. Nancy Ide and Jean Veronis, ISBN 0-7923-3704-2.</bibl>
<bibl id="charmod" href="http://www.w3.org/TR/charmod/" key="CMOD">Martin
D&#xfc;rst and Fran&#xe7;ois Yergeau, editors. <titleref href="http://www.w3.org/TR/charmod/">Character
Model for the World Wide Web</titleref>. World Wide Web Consortium, 
1999.</bibl>
<bibl id="dexter" key="Dexter">Halasz, Frank. 1994. <quote>The Dexter Hypertext
Reference Model.</quote> In <titleref>Communications of the Association for
Computing Machinery</titleref> 37 (2), February 1994: 30-39.</bibl>
<bibl id="xptr-errata" href="" key="ERR"><titleref>XPointer 
Errata</titleref>.
This document will be created when XPointer goes to Recommendation. Until
that time, check the public XML Linking page at <loc href="http://www.w3.org/XML/Linking.html">http://www.w3.org/XML/Linking.html</loc>.</bibl>
<bibl id="fress" href=" http://www.stg.brown.edu/~sjd/fress.html" key="FRESS">Steven
J. DeRose and Andries van Dam. 1999. <quote>Document structure in the FRESS
Hypertext System.</quote> <titleref>Markup Languages 1</titleref> (1) Winter.
Cambridge: MIT Press: 7-32.</bibl>
<bibl id="html" href="http://www.w3.org/TR/html4/" key="HTML"><titleref href="http://www.w3.org/TR/html4/">HTML
4.01 Specification</titleref>. World Wide Web Consortium, 1999.</bibl>
<bibl id="intermedia" key="Intermedia">Yankelovich, Nicole, Bernard J. Haan,
Norman K. Meyrowitz, and Steven M. Drucker. 1988. <quote>Intermedia: 
The Concept
and the Construction of a Seamless Information Environment.</quote> 
<titleref>IEEE
Computer</titleref> 21 (January, 1988): 81-96.</bibl>
<bibl id="iso10744" href=" 
http://www.ornl.gov/sgml/wg8/docs/n1920/html/n1920.html" key="ISO/IEC 10744"><titleref>ISO/IEC 10744-1992 (E). Information technology
--Hypermedia/Time-based Structuring Language (HyTime).</titleref> Geneva:
International Organization for Standardization, 1992. 
<titleref>Extended Facilities
Annex.</titleref> [Geneva]: International Organization for Standardization,
1996.</bibl>
<bibl id="iuri" href="http://www.w3.org/International/2000/03/draft-masinter-url-i18n-05.txt" key="IURI"><titleref>Internationalized URIs.</titleref> Expired Internet-Draft.
Internet Engineering Task Force, 2000.</bibl>
<bibl id="microcosm" key="MicroCosm">Hall, Wendy, Hugh Davis, and 
Gerard Hutchings.
1996. <titleref>Rethinking Hypermedia: The Microcosm Approach.</titleref>
Boston: Kluwer Academic Publishers. ISBN 0-7923-9679-0.</bibl>
<bibl id="ohs" href="http://aue.auc.dk/~kock/OHS-HT98/Papers/ossenbruggen.html" key="OHS">van Ossenbruggen, Jacco, Anton Eli&#xeb;ns and Lloyd Rutledge. <quote>The
Role of XML in Open Hypermedia Systems.</quote> Position paper for the 4th
Workshop on Open Hypermedia Systems, ACM Hypertext '98.</bibl>
<bibl id="rlocs" href="http://www.cs.berkeley.edu/~phelps/Robust/papers/RobustHyperlinks.html" key="RLocs">Thomas A Phelps and Robert Wilensky. <titleref>Robust 
Intra-document
Locations.</titleref> University of California, Berkeley.</bibl>
<bibl id="tei" href="http://www.uic.edu/orgs/tei/p3/" key="TEI">C. M. 
Sperberg-McQueen
and Lou Burnard, editors. <titleref>Guidelines for Electronic Text Encoding
and Interchange</titleref>. Association for Computers and the Humanities (ACH),
Association for Computational Linguistics (ACL), and Association for Literary
and Linguistic Computing (ALLC). Chicago, Oxford: Text Encoding Initiative,
1994.</bibl>
<bibl id="xhtml" href="http://www.w3.org/TR/xhtml1/" key="XHTML"><titleref href="http://www.w3.org/TR/xhtml1/">XHTML 1.0: The Extensible HyperText Markup
Language</titleref>. World Wide Web Consortium, 2000.</bibl>
<bibl id="infoset" href="http://www.w3.org/TR/xml-infoset/" key="XIS">John
Cowan and Richard Tobin, editors. <titleref>XML Information Set</titleref>.
World Wide Web Consortium, 2001.</bibl>
<bibl id="XLink" href="http://www.w3.org/TR/xlink/" key="XLink">Steve DeRose,
Eve Maler, David Orchard, and Ben Trafford, editors. <titleref>XML Linking
Language (XLink)</titleref>. World Wide Web Consortium, 2000.</bibl>
<bibl id="xpreq" href="http://www.w3.org/TR/NOTE-xptr-req" key="XPREQ">Steve
DeRose, editor. <titleref>XML XPointer Language Requirements Version 
1.0</titleref>.
World Wide Web Consortium, 1999.</bibl>
<bibl id="XSLT" href="http://www.w3.org/TR/xslt" key="XSLT">James 
Clark, editor. <titleref>XSL
Transformations (XSLT) Version 1.0</titleref>. World Wide Web Consortium,
1999.</bibl>
</blist></div2>
</div1>
<inform-div1>
<head id="wgmembers">Working Group Members
</head>
<p>The first working drafts of this specification were developed in the XML
Working Group, whose members are listed in <bibref ref="XML"/>. The work was
completed in the XML Linking Working Group, with the following members active
at the completion of this specification:</p>
<orglist>
<member><name>Peter Chen</name><affiliation>LSU, Bootstrap 
Alliance</affiliation>
</member>
<member><name>Ron 
Daniel</name><affiliation>Interwoven</affiliation><role>XPointer
co-editor</role></member>
<member><name>Steven DeRose</name><affiliation>invited expert</affiliation>
<role>XPointer co-editor</role></member>
<member><name>David Durand</name><affiliation>University of Southhampton,
Dynamic Diagrams</affiliation></member>
<member><name>Masatomo Goto</name><affiliation>Fujitsu 
Laboratories</affiliation>
</member>
<member><name>Paul Grosso</name><affiliation>Arbortext</affiliation></member>
<member><name>Chris Maden</name><affiliation>Lexica</affiliation></member>
<member><name>Eve Maler</name><affiliation>Sun Microsystems</affiliation>
<role>past co-chair and co-editor</role></member>
<member><name>Jonathan 
Marsh</name><affiliation>Microsoft</affiliation></member>
<member><name>David 
Orchard</name><affiliation>Jamcracker</affiliation></member>
<member><name>Henry
Thompson</name><affiliation>W3C and University of Edinburgh</affiliation>
<role>co-chair and W3C staff contact</role></member>
<member><name>Daniel Veillard</name><affiliation>W3C staff 
contact</affiliation>
<role>co-chair</role></member>
</orglist>
<p>The editors wish to acknowledge substantial contributions from Tim Bray,
who previously served as co-editor and co-chair. We would also like 
to acknowledge
substantial contributions from James Clark, especially on the integration
with XPath. We would like to thank Gavin Nicol and Martin D&#xfc;rst for help with
passages related to internationalization. Finally, we would like to thank
the XML Linking Interest Group and Working Group for their support 
and input.</p>
</inform-div1>
</back></spec>
