<?xml version="1.0"?>
<presentation>

  <title>XLinks and XPointers</title>
  <date>August 25, 1999</date>
  <host>XML SIG of the <a href="http://www.objdev.org">New York Object Developers Group</a></host>
  <copyright>1999 Elliotte Rusty Harold</copyright>
  <default_last_modified>August 20, 1999</default_last_modified>
  <last_modified>August 25, 1999</last_modified>
  <author_name>Elliotte Rusty Harold</author_name>
  <author_url>http://www.macfaq.com/personal.html</author_url>
  <author_email>Elliotte Rusty Harold</author_email>
  
  <slide>
  <title>XLinks and XPointers</title>
  
  <h2 align="center">Elliotte Rusty Harold</h2>
  <h2 align="center">XML Developers SIG August 24, 1999</h2>
  <h3 align="center">elharo@metalab.unc.edu</h3>
  <h3 align="center">http://metalab.unc.edu/xml/</h3>

<div align="center">
<IMG SRC="mediumbiblecover.jpg" width="220" height="271"/>
</div>

  </slide>
  
  
  <slide>
    <title>Three Technologies</title>
    
    <p>XLL, the eXtensible Linking Language, is divided into three parts, XLinks, XPointer, and XPath. </p>
    <ul>
    <li>XLinks</li>
    <li>XPointers</li>
    <li>XPath</li>
    </ul>
    <p>
XLink, the XML Linking Language, defines how one document links
to another document. XPointer, the XML Pointer Language, defines
how individual parts of a document are addressed. XPath is a syntax
used in XPointers  for 
identifying particular nodes in an XML document's tree. 
</p>

<p>An XLink points
to a URI (in practice, a URL) that specifies a particular
resource. This URL may include an XPointer part that more
specifically identifies the desired part or section of the
targeted resource or document. XPointers use the XPath syntax shared with 
XSL to identify particular elements in the document tree.</p>
    
  </slide>

<slide>
<title>Versions</title>

    <p>This talk covers:</p>
    
    <ul>
    <li>XLinks: <a href="http://www.w3.org/1999/07/WD-xlink-19990726">July 26 Working Draft</a></li>
    <li>XPointers: <a href="http://www.w3.org/1999/07/WD-xptr-19990709">July 9 Working Draft</a></li>
    <li>XPath: <a href="http://www.w3.org/1999/08/WD-xpath-19990813.html">August 13 Working Draft</a></li>
    </ul>
    
<p>These should be pretty close to the final versions. Last call on XPath is September 2.</p>

<note>
<p>
I'm going to focus on XSL and XPointers, and XPath only tangentially.
XPath is a big subject, that could easily be a lecture of its own.
Some of you are already familiar with it from XSL.
Those of you who aren't would probably be better off learning the
details of it in
the context of XSL where you can actually try it out.
I'll explain what we need of it as we discuss XPointers.
</p>
</note>

</slide>

  <slide>
    <title>HTML Links are Limited</title>
    
    <ul>
      <li>The Web conquered  gopher for one reason: HTML made it possible to embed hypertext links in documents.</li>
    <li>HTML linking has limits</li>
      <ul>
      <li>You can only link to one document at a time</li>
      <li>You must link to the entire document.</li>
      <li>Once the link is traversed the trail of where you've been is lost.</li>
      </ul>
    
    </ul>
    
<note>    
<p>The Web conquered the more established gopher protocol for one main reason: HTML made it possible to embed hypertext links in documents. These links could insert images or let the user to jump from inside one document to another document or another part of the same document. To the extent that XML is rendered into other formats such as HTML for viewing, the same syntax HTML uses for linking can be used in XML documents. Alternate syntaxes can be converted into HTML syntax using XSL, as you saw in several examples in Chapter 14.</p>

<p>However, HTML linking has limits. For one thing, URLs are limited to pointing at a single document. More granularity than that, such as linking to the third sentence of the 17th paragraph in a document, requires you to manually insert named anchors in the targeted file. It can't be done without write access to the document to which you're linking.</p>

<p>Furthermore, HTML links don't maintain any sense of history or relations between documents. Although browsers may track the path you've followed through a series of documents, such tracking isn't very reliable. From inside the HTML, there's no way to know from where a reader came. Links are purely one way. The linking document knows to whom it's linking, but not vice versa.</p>
</note>
</slide>

<slide>
<title>XLinks are More Powerful</title>

<note>
<p>XLL proposes more powerful links between documents called XLinks. It's designed especially for use with XML documents, but some parts can be used with HTML files as well. XLinks can do everything HTML's URL-based hyperlinks and anchors can do.
</p>
</note>

<ul>
<li>Designed especially for use with XML</li>
<li>Multidirectional</li>
<li>Any element can be a link, not just <code>&lt;A&gt;</code></li>
<li>Can link to arbitrary positions in the document</li>
</ul>


<note><p>
Beyond this, however, XLinks provide multidirectional links where the links run in more than one direction. Any element can become a link, not just the <code>A</code> element. Links do not even have to be stored in the same file as the documents they link. Furthermore, the XPointer part (described in the next chapter) allows links to arbitrary positions in an XML document. These features make XLL more suitable not only for new uses, but for things that can be done only with considerable effort in HTML, such as cross-references, footnotes, end notes, interlinked data, and more.</p></note>

</slide>

<slide><title>Application Support</title>

<p>Currently, there are no general-purpose applications that support arbitrary XLinks. That's because XLinks have a much broader base of applicability than HTML links. XLinks are not just used for hypertext connections and embedding images in documents. They can be used by any custom application that needs to establish connections between documents and parts of documents, for any reason. Thus, even when XLinks are fully implemented in browsers they may not always be blue underlined text that you click to jump to another page. They can be that, but they can also be both more and less, depending on your needs.</p>

</slide>


<slide>
<title>Linking Elements</title>

<note>
<p>In HTML, a link is defined with the <code>&lt;A&gt;</code> tag. However, just as XML is more flexible with tags that describe elements, it is more flexible with tags that refer to external resources. In XML, almost any tag can be a link. Elements that include links are called <dfn>linking elements</dfn>.</p>
</note>

<ul>
<li>Any element can be a link</li>
<li>Linking elements are identified by an <code>xlink:type</code> attribute with one of these four values:</li>

<ul>

<li><code>simple</code></li>
<li><code>extended</code></li>
<li><code>locator</code></li>
<li><code>arc</code></li>
</ul>

<li>Each linking element contains an <code>xlink:href</code> attribute whose value is the URI of the resource being linked to. </li>
<li>An <code>xmlns:xlink</code> attribute specifies the version of XLink this linking element supports. </li>
</ul>

</slide>


<slide>

<title>For example</title>



<pre><code>&lt;FOOTNOTE xmlns:xlink="http://www.w3.org/XML/XLink/0.9"
          xlink:type="simple"
          xlink:href="footnote7.xml"&gt;7&lt;/FOOTNOTE&gt;
&lt;COMPOSER xmlns:xlink="http://www.w3.org/XML/XLink/0.9"
          xlink:type="simple"
          xlink:href="http://www.interport.net/~beand/"&gt;
    Beth Anderson
&lt;/COMPOSER&gt;
&lt;IMAGE xmlns:xlink="http://www.w3.org/XML/XLink/0.9"
       xlink:type="simple" xlink:href="logo.gif"/&gt;
</code></pre>

<note>
<p>Notice that the elements have semantic names that describe the content they contain rather than how the elements behave. The information that these elements are links is included in the attributes of the tags.</p>

<p>These three examples are simple XLinks. Simple XLinks are similar to standard HTML links and are likely to be supported by application software before the more complex (and more powerful) extended links, so I'll begin with them.</p>

<p>In the <code>FOOTNOTE</code> example above, the link target attribute's name is <code>xlink:href</code>. Its value is the relative URL <code>footnote7.xml</code>. The protocol, host, and directory of this document are taken from the protocol, host, and directory of the document in which this link appears.</p>

<p>In the <code>COMPOSER</code> example above, the link target attribute's name is <code>xlink:href</code>. The value of the <code>xlink:href</code> attribute is the absolute URL http://www.interport.net/~beand/. In the third example above, which is <code>IMAGE</code>, the link target attribute's name is also <code>xlink:href</code>. The value of the <code>xlink:href</code> attribute is the relative URL <code>logo.gif</code>. Again, the protocol, host, and directory of this document are taken from the protocol, host, and directory of the document in which this link appears.</p>

<p>The <code>xlink:</code> that starts both <code>xlink:type</code> and <code>xlink:href</code> is a namespace prefix. It indicates that these attributes are part of the XLink namespace associated with the URI http://www.w3.org/XML/XLink/0.9 as indicated by the <code>xmlns:xlink</code> attribute. This namespace can be declared either on the root element of the document or on the individual elements that use the <code>xlink</code> prefix. Attributes of elements that themselves use the <code>xlink</code> prefix drop the prefix. For instance, the <code>xlink:href</code> attribute of a <code>COMPOSER</code> element becomes merely the <code>href</code> attribute of an <code>xlink:simple</code> element.</p>

<p>Caution</p>

<p>The 0.9 in http://www.w3.org/XML/XLink/0.9 suggests that this URI is likely to change in the future. However, by assigning different URIs to different versions of the XLink specification, a browser can recognize and support more than one version of the syntax. This is one of the prime advantages of namespaces.</p>

</note>
</slide>



<slide><title>Declaring XLink Attributes in DTDs</title>

<note>
<p>If the document has a DTD, these attributes must be declared like any other. For example, DTD declarations of the <code>FOOTNOTE</code>, <code>COMPOSER</code>, and <code>IMAGE</code> elements might look like this:</p>
</note>

<pre><code>&lt;!ELEMENT FOOTNOTE (#PCDATA)&gt;
&lt;!ATTLIST FOOTNOTE
  xmlns:xlink CDATA #FIXED "http://www.w3.org/XML/XLink/0.9"
  xlink:type  CDATA #FIXED "simple"
  xlink:href  CDATA #REQUIRED
&gt;
&lt;!ELEMENT COMPOSER (#PCDATA)&gt;
&lt;!ATTLIST COMPOSER
  xmlns:xlink CDATA #FIXED "http://www.w3.org/XML/XLink/0.9"
  xlink:type  CDATA #FIXED "simple"
  xlink:href  CDATA #REQUIRED
&gt;
&lt;!ELEMENT IMAGE EMPTY&gt;
&lt;!ATTLIST IMAGE
  xmlns:xlink CDATA #FIXED "http://www.w3.org/XML/XLink/0.9"
  xlink:type  CDATA #FIXED "simple"
  xlink:href  CDATA #REQUIRED
&gt;</code>
</pre>

</slide>


<slide>
<title>Fixed Attributes</title>

<note>
<p>With these declarations, the <code>xlink:type</code> and <code>xmlns:xlink</code> attributes have fixed values. Therefore they do not need to be included in the instances of the elements, which you may now write more compactly like this:</p>
</note>

<pre><code>&lt;FOOTNOTE xlink:href="footnote7.xml"&gt;7&lt;/FOOTNOTE&gt;
&lt;COMPOSER xlink:href="http://www.interport.net/~beand/"&gt;
  Beth Anderson
&lt;/COMPOSER&gt;
&lt;IMAGE xlink:href="logo.gif"/&gt;</code>
</pre>

</slide>


<slide>
<title>Other Attributes</title>

<note>
<p>Making an element a link doesn't impose any restriction on other attributes or contents of an element. A linking element may contain arbitrary children or other attributes, always subject to the restrictions of the DTD, of course. For example, here's a more realistic declaration of the <code>IMAGE</code> element. Note that most of the attributes don't have anything to do with linking.</p>
</note>

<pre><code>&lt;!ELEMENT IMAGE EMPTY&gt;
&lt;!ATTLIST IMAGE
  xmlns:xlink CDATA #FIXED "http://www.w3.org/XML/XLink/0.9"
  xlink:type  CDATA #FIXED "simple"
  xlink:href  CDATA #REQUIRED
  ALT         CDATA #REQUIRED
  HEIGHT      CDATA #REQUIRED
  WIDTH       CDATA #REQUIRED
&gt;</code>
</pre>
</slide>


<slide>
  <title>xlink:simple</title>

<note>
<p>You may not wish to entangle your tag set and DTD with link attributes. If so, rather than adding the attributes like <code>xlink:href</code> and <code>xlink:type</code> to elements in your own tag set, you can use an <code>xlink:simple</code> element to wrap links around your own elements. This is similar to how you can wrap an HTML <code>A</code> element around <code>P</code>, <code>STRONG</code>, <code>BLOCKQUOTE</code>. or other HTML elements. The <code>xlink:simple</code> element uses the same attributes as any linking element, with the small difference that you do need to attach the <code>xlink:</code> prefix to the individual attributes. For instance, the three earlier examples could be rewritten using <code>xlink:simple</code> like this:</p>
</note>


<pre><code>&lt;xlink:simple 
  xmlns:xlink="http://www.w3.org/XML/XLink/0.9"
  href="footnote7.xml"&gt;
  &lt;FOOTNOTE&gt;7&lt;/FOOTNOTE&gt;
&lt;/xlink:simple&gt;

&lt;xlink:simple 
  xmlns:xlink="http://www.w3.org/XML/XLink/0.9"
  href="http://www.interport.net/~beand/"&gt;
  &lt;COMPOSER&gt;Beth Anderson&lt;/COMPOSER&gt;
&lt;/xlink:simple&gt;

&lt;IMAGE&gt;
  &lt;xlink:simple 
    xmlns:xlink="http://www.w3.org/XML/XLink/0.9"
    href="logo.gif"/&gt;
&lt;/IMAGE&gt;</code>
</pre>

<note>
<p>Some people find this approach cleaner and easier to understand. Others don't. Feel free to use elements or attributes for links as you prefer. Of course if you do use the <code>xlink:simple</code> element in a valid document, you have to declare it just like any other element. You have to declare its child elements, though often this is simply defaulted to <code>ANY</code>. You have to declare its attributes. You also have to declare it as a child of any element that will contain it. For example,</p>
</note>

<p>If used in a valid document, <code>xlink:simple</code> must be declared</p>

<pre><code>&lt;!ELEMENT xlink:simple ANY&gt;
&lt;!ATTLIST xlink:simple 
 xmlns:xlink CDATA #FIXED "http://www.w3.org/XML/XLink/0.9"
  href       CDATA #REQUIRED 
&gt;</code>
</pre>

</slide>

<slide>
<title>Descriptions of the Remote Resource</title>
<p>A link element may contain optional <code>xlink:role</code> and <code>xlink:title</code> attributes that describe the remote resource, that is, the document or other resource to which the link points. For example:</p>



<pre><code>&lt;AUTHOR 
 xmlns:xlink="http://www.w3.org/XML/XLink/0.9"
 xlink:href="http://www.macfaq.com/personal.html"
 xlink:title="Elliotte Rusty Harold's personal home page" 
 xlink:role="information about the author of this book"&gt;
   Elliotte Rusty Harold
&lt;/AUTHOR&gt;</code>
</pre>

<note>
<p>The <code>role</code> and <code>title</code> attributes describe the remote resource, not the local element. The remote resource in the above example is the document at <code>http://www.macfaq.com/personal.html</code>. Thus, the above example says that the page at <code>http://www.macfaq.com/personal.html</code> has the title "Elliotte Rusty Harold's personal home page" and the role "information about the author of this book". 
It is not uncommon, though it's not required, for the <code>xlink:title</code> to be the same as the contents of the <code>TITLE</code> element of the page to which you are linking.</p>

<p>The application reading the XML might use these two attributes to show extra information to the user. However, the application is not required to show this information to the user or do anything with it.</p>

<p>The <code>xlink:role</code> attribute indicates the purpose of the remote resource (the one to which it's linked) in the linking document (the one from which it's linked). For example, it might distinguish between footnotes, endnotes, and citations.</p>
</note>


<p>As with all other attributes, the <code>xlink:title</code> and <code>xlink:role</code> attributes should be declared in the DTD for all the elements to which they belong. For example, this is a reasonable declaration for the above <code>AUTHOR</code> element:</p>



<pre><code>&lt;!ELEMENT AUTHOR (#PCDATA)&gt;
&lt;!ATTLIST AUTHOR
  xmlns:xlink CDATA #FIXED "http://www.w3.org/XML/XLink/0.9"
  xlink:type  CDATA #FIXED "simple"
  xlink:href  CDATA #REQUIRED
  xlink:title CDATA #IMPLIED
  xlink:role  CDATA #IMPLIED
&gt;</code>
</pre>

</slide>

<slide>
<title>role and title</title>

<p>If you're using <code>xlink:simple</code>, then the <code>xlink:role</code> 
and <code>xlink:title</code> attributes are simply <code>role</code> and 
<code>title</code>. For example:</p>


<pre><code>&lt;xlink:simple 
 xmlns:xlink="http://www.w3.org/XML/XLink/0.9"
 href="http://www.macfaq.com/personal.html"
 title="Elliotte Rusty Harold's personal home page" 
 role="information about the author of this book"&gt;
   &lt;AUTHOR&gt;Elliotte Rusty Harold&lt;/AUTHOR&gt;
&lt;/xlink:simple&gt;</code>
</pre>

</slide>

<slide>
<title>Link Behavior</title>

<p>Linking elements can contain two more optional attributes that suggest to applications how the remote resource is associated with the current page. These are:</p>

<ul>

<li><code>xlink:show</code> suggests how the content should be displayed when the link is activated</li>
<li><code>xlink:actuate</code> suggests whether the link should be traversed automatically or whether a specific user request is required</li>
<li>These are application dependent, however, and applications are free to ignore the suggestions.</li>
<li>In an <code>xlink:simple</code> element the prefix is dropped so these are just <code>show</code> and <code>actuate</code> respectively.</li>
</ul>

</slide>

<slide>
<title> xlink:show  </title>

<p>
The <code>xlink:show</code> attribute has three legal values: 
</p>

<ul>
	<li><code>replace</code> </li>
	<li><code>new</code></li>
	<li><code>parsed</code></li>
</ul>

<note>
<p>If the value of <code>xlink:show</code> is <code>replace</code>, then when the link is activated (generally by clicking on it, at least in GUI browsers), the target of the link replaces the current document in the same window. This is the default behavior of HTML links. </p>



<p>If the value of <code>xlink:show</code> is <code>new</code>, activating the link opens a new window in which the targeted resource is displayed. This is similar to the behavior of HTML links when the <code>target</code> attribute is set to <code>_blank</code>.</p>

<p>Readers do not expect a new window to open after clicking a link. They expect that when they click a link, the new page will load into the current window, unless they specifically ask for the link to open in a new window.</p>

<p>Some companies are so self-important that they find it impossible to believe that any user would ever want to leave their sites. Thus they "help" the readers by opening new windows. Most of the time this only serves to confuse and annoy. Don't change the behavior users expect without a very good reason. The thin hope that a reader might spend an additional two seconds on your site or view one more page and see one more ad is not a good enough reason.</p>

<p>If the value of <code>xlink:show</code> is <code>parsed</code>, activating the link inserts the targeted resource into the existing document. Exactly what this means is application dependent. However, you can imagine it being used to provide client-side includes for Web pages. </p>
</note>


<p>Like all attributes in valid documents, the <code>xlink:show</code> attribute must be declared in a <code>&lt;!ATTLIST&gt;</code> declaration for the DTD's link element. For example:</p>


<pre><code>&lt;!ELEMENT WEBSITE (#PCDATA)&gt;
&lt;!ATTLIST WEBSITE 
 xmlns:xlink CDATA #FIXED "http://www.w3.org/XML/XLink/0.9"
 xlink:type  CDATA  #FIXED "simple"
 xlink:href  CDATA  #REQUIRED
 xlink:show (new | replace | parsed) #IMPLIED "replace"
&gt;</code>
</pre>

</slide>

<slide>
<title>xlink:actuate</title>
<last_modified>August 25, 1999</last_modified>
<p>A linking element's <code>xlink:actuate</code> attribute has two possible values:</p>

<ul>
<li> <code>user</code></li>
<li> <code>auto</code></li>
</ul>

<note>
<p>
 The value <code>user</code>, the default, specifies that the link is to be 
 traversed only when and if the user requests it. On the other hand, if the link element's <code>xlink:actuate</code> attribute is set to <code>auto</code>, the link is traversed once the link is loaded. For example, you might set the actuate attribute to auto for an image or other piece of external content that's to be embedded in the linking document. This way the user doesn't have to click the link to follow it. For example, </p>
</note>


<pre><code>&lt;IMAGE 
  xmlns:xlink="http://www.w3.org/XML/XLink/0.9" 
       xlink:type="simple" xlink:href="logo.gif"
       xlink:actuate="auto"/&gt;</code>
</pre>

<p>Like all attributes in valid documents, the <code>actuate</code> attribute must be declared in the DTD in a <code>&lt;!ATTLIST&gt;</code> declaration for the link elements in which it appears. For example:</p>



<pre><code>&lt;!ELEMENT IMAGE EMPTY&gt;
&lt;!ATTLIST IMAGE 
 xmlns:xlink CDATA #FIXED "http://www.w3.org/XML/XLink/0.9"
  xlink:type CDATA #FIXED "simple"
  xlink:href CDATA #REQUIRED
  xlink:show    (new | replace | parsed) #IMPLIED "parsed"
  xlink:actuate (user | auto)            #IMPLIED "auto"
&gt;</code>
</pre>

</slide>

<slide>
<title>Parameter Entities for Link Attributes</title>

<note>
<p>Because the attribute names and types are standardized, if you have more than one link element in a document, often it's convenient to make the attribute declarations a parameter entity reference and simply repeat that in the declaration of each linking element. For example:</p>
</note>

<pre><code>&lt;!ENTITY % link-attributes
 "xlink:type    CDATA  #FIXED 'simple'
  xlink:role    CDATA  #IMPLIED
  xlink:title   CDATA  #IMPLIED

  xmlns:xlink CDATA #FIXED 'http://www.w3.org/XML/XLink/0.9'
  xlink:href    CDATA  #REQUIRED
  xlink:show    (new | replace | parsed) #IMPLIED 'replace'
  xlink:actuate (user | auto)            #IMPLIED 'user'"
&gt;

&lt;!ELEMENT COMPOSER (#PCDATA)&gt;
&lt;!ATTLIST COMPOSER 
  %link-attributes;
&gt;
&lt;!ELEMENT AUTHOR (#PCDATA)&gt;
&lt;!ATTLIST AUTHOR
  %link-attributes;
&gt;
&lt;!ELEMENT WEBSITE (#PCDATA)&gt;
&lt;!ATTLIST WEBSITE
  %link-attributes;
&gt;
</code></pre>

</slide>

<slide>
<title>Extended Links</title>

<ul>
<li>Simple links are very similar to HTML links, one-directional,
one-element-to-one-document links</li>
<li>Extended links are multi-directional, many-to-many links</li>
<li>An extended link is a list of nodes and a list of the 
connections between them</li>
</ul>

<note>
<p>Simple links behave more or less like the standard links you're accustomed to from HTML. A simple link connects one element in the linking document to one target document. Furthermore, the link is one way, from the source to the target.</p>

<p>Extended links, however, go substantially beyond what you can do with an HTML link to include multidirectional links between many documents and out-of-line links. An extended link consists of a set of locations and a set of the connections between them. Each location may be either a target or a source of a link or both. </p>

<p>In computer science terms, an extended link is a directed labeled graph in which the locations are vertices and the links between nodes are the edges. Thought of abstractly like this, an extended link is really just an XML format for a directed labeled graph data structure in which each vertex is labeled with a particular URI. The tricky part comes in deciding exactly what any particular application is supposed to do with such a data structure. For now, we can only guess what applications might do with extended links and what sort of user interfaces they might provide.</p>
</note>

</slide>

<slide>
<title>Extended Link Elements</title>

<ul>
<li><p><code>xlink:extended</code> element</p>

<pre><code>&lt;?xml version="1.0"?&gt;
&lt;WEBSITE&gt;
  &lt;xlink:extended 
    xmlns:xlink="http://www.w3.org/XML/XLink/0.9"&gt;
    &lt;!-- Locators go here --&gt;
  &lt;/xlink:extended&gt;
&lt;/WEBSITE&gt;</code>
</pre>

</li>
<li><p>An element of arbitrary type like <code>COMPOSER</code> or 
<code>TEAM</code> that has <code>xlink:type</code> attribute with 
the value <code>extended</code></p>

<pre><code>&lt;?xml version="1.0"?&gt;
&lt;WEBSITE
  xmlns:xlink="http://www.w3.org/XML/XLink/0.9"
  xlink:type="extended"&gt;
    &lt;!-- Locators go here --&gt;
&lt;/WEBSITE&gt;</code>
</pre>


</li>
</ul>
<note>
<p>An extended link is included in an XML document in one of two ways. It is either an <code>xlink:extended</code> element or it is an element of some other type like <code>COMPOSER</code> or <code>TEAM</code> that has <code>xlink:type</code> attribute with the value <code>extended</code>. </p>
</note>

</slide>

<slide>
<title>Locators</title>

<note>
<p>Extended links generally point to more than one target. To allow this, extended links store the targets (and sources) in child locator elements of the linking element rather than in a single <code>xlink:href</code> attribute of the linking element as simple links do. These locator children can either be <code>xlink:locator</code> elements or they can be elements of arbitrary type whose <code>xlink:type</code> attribute has the value locator. Each locator element has an <code>href</code> or <code>xlink:href</code> that contains a URI for the location.
</p> </note>

<ul>
<li>The nodes (link sources and targets) are locator elements </li>
<li>These are children of the extended link element</li>
<li><p>A locator element is either</p>
<ul>
<li>An <code>xlink:locator</code> element</li>
<li>An element whose <code>xlink:type</code> attribute has the value <code>locator</code></li>
</ul>
</li>

</ul>

</slide>

<slide>
<title>xlink:type="locator"</title>



<note>
<p>For example, here's an extended link for four copies of one site:</p>
</note>

<pre><code>&lt;?xml version="1.0"?&gt;
&lt;WEBSITE xmlns:xlink="http://www.w3.org/XML/XLink/0.9"
         xlink:type="extended"&gt;
  &lt;HOMESITE xlink:type="locator" 
            xlink:href="http://metalab.unc.edu/javafaq/"&gt;
    North Carolina
  &lt;/HOMESITE&gt;
  &lt;MIRROR xlink:type="locator" 
          xlink:href="http://sunsite.kth.se/javafaq"&gt;
    Sweden
  &lt;/MIRROR&gt;
  &lt;MIRROR xlink:type="locator" 
          xlink:href="http://sunsite.uakom.sk/javafaq/"&gt;
    Slovakia
  &lt;/MIRROR&gt;
  &lt;MIRROR xlink:type="locator" 
          xlink:href="http://sunsite.cnlab-switch.ch/javafaq/"&gt;
    Switzerland
  &lt;/MIRROR&gt;
&lt;/WEBSITE&gt;</code>
</pre>

</slide>

<slide>
<title>xlink:locator</title>

<note>
<p>
Here's
 an alternative version that uses 
 <code>xlink:extended</code> and <code>xlink:locator</code> elements.</p>
</note>
<pre><code>&lt;?xml version="1.0"?&gt;
&lt;WEBSITE&gt;
  &lt;xlink:extended 
    xmlns:xlink="http://www.w3.org/XML/XLink/0.9"&gt;
    &lt;xlink:locator 
      href="http://metalab.unc.edu/javafaq/"&gt;
      &lt;HOMESITE&gt;North Carolina&lt;/HOMESITE&gt;
    &lt;/xlink:locator&gt;
    &lt;xlink:locator 
      href="http://sunsite.kth.se/javafaq"&gt;
      &lt;MIRROR&gt;Sweden&lt;/MIRROR&gt;
    &lt;/xlink:locator&gt;
    &lt;xlink:locator 
      href="http://sunsite.uakom.sk/javafaq/"&gt;
      &lt;MIRROR&gt;Slovakia&lt;/MIRROR&gt;
    &lt;/xlink:locator&gt;
    &lt;xlink:locator 
      href="http://sunsite.cnlab-switch.ch/javafaq/"&gt;
      &lt;MIRROR&gt;Switzerland&lt;/MIRROR&gt;
    &lt;/xlink:locator&gt;
  &lt;/xlink:extended&gt;
&lt;/WEBSITE&gt;</code>
</pre>

<note>
<p>Both the extended link element itself and the individual locator children may have descriptive attributes such as <code>role</code> and <code>title</code>. The <code>xlink:role</code> and <code>xlink:title</code> attributes of the extended link element provide default roles and titles for each of the individual locator child elements. Individual locator elements may override these defaults with <code>role</code> and <code>title</code> (or <code>xlink:role</code> and <code>xlink:title</code>) attributes of their own. </p>
</note>

</slide>

<slide>
<title>Locators in DTDs</title>

<note>
<p>As always, in valid documents, the link elements and all their possible 
attributes must be declared in the DTD. For example, here's a DTD fragment that 
declares the <code>WEBSITE</code>, <code>HOMESITE</code>, and 
<code>MIRROR</code> elements as used in the example above, as well as their 
attributes:</p>
</note>

<pre><code>&lt;!ELEMENT WEBSITE (HOMESITE, MIRROR*) &gt;
&lt;!ATTLIST WEBSITE
 xmlns:xlink CDATA #FIXED "http://www.w3.org/XML/XLink/0.9"
 xlink:type  (simple|extended|locator|arc) #FIXED "extended"
 xlink:title CDATA  #IMPLIED
 xlink:role  CDATA  #IMPLIED
&gt;

&lt;!ELEMENT HOMESITE (#PCDATA)&gt;
&lt;!ATTLIST HOMESITE
  xlink:type (simple|extended|locator|arc) #FIXED "locator"
  xlink:href      CDATA                    #REQUIRED
  xlink:role      CDATA                    #IMPLIED
  xlink:title     CDATA                    #IMPLIED
&gt;

&lt;!ELEMENT MIRROR (#PCDATA)&gt;
&lt;!ATTLIST MIRROR
  xlink:type (simple|extended|locator|arc) #FIXED "locator"
  xlink:href      CDATA                    #REQUIRED
  xlink:role      CDATA                    #IMPLIED
  xlink:title     CDATA                    #IMPLIED
&gt;</code>
</pre>

</slide>

<slide>
<title>Parameter Entities for these  DTDs</title>

<note>
<p>If you have many extended link and locator elements, it may be advantageous to define the common attributes in parameter entities in the DTD, which you can reuse in different elements. For example:</p>
</note>

<pre><code>&lt;!ENTITY % extended.att
  "xlink:type   CDATA  #FIXED 'extended'
   xmlns:xlink  CDATA  #FIXED 'http://www.w3.org/XML/XLink/0.9'
   xlink:role   CDATA  #IMPLIED
   xlink:title  CDATA  #IMPLIED"
&gt;

&lt;!ENTITY % locator.att
  "xlink:type (simple|extended|locator|arc) #FIXED  'locator'
   xlink:href         CDATA  #REQUIRED
   xlink:role         CDATA  #IMPLIED
   xlink:title        CDATA  #IMPLIED"
&gt;

&lt;!ELEMENT WEBSITE (HOMESITE, MIRROR*) &gt;
&lt;!ATTLIST WEBSITE
   %extended.att;
&gt;

&lt;!ELEMENT HOMESITE (#PCDATA)&gt;
&lt;!ATTLIST HOMESITE
   %locator.att;
&gt;

&lt;!ELEMENT MIRROR (#PCDATA)&gt;
&lt;!ATTLIST MIRROR
   %locator.att;
&gt;
</code></pre>
</slide>

<slide>
<title>Arcs</title>

<note>
<p>The <code>show</code> and <code>actuate</code> attributes of a simple link 
define how and when a link is traversed. Extended links are a little more 
complicated however because they provide many possible different directions of 
traversal. For example in an extended link with three locators, A, B, and C; 
there are nine different possible traversals. These are:</p>

<ul>

<li>A --&gt; A</li>
<li>B --&gt; B</li>
<li>C --&gt; C</li>
<li>A --&gt; B</li>
<li>B --&gt; A</li>
<li>A --&gt; C</li>
<li>C --&gt; A</li>
<li>B --&gt; C</li>
<li>C --&gt; B</li>
</ul>

<p>These are called arcs, and they're represented in XML by 
<code>xlink:arc</code> elements or elements  that have an 
<code>xlink:type</code> attribute with the value arc. Some applications may use 
arc elements to determine which traversals are and are not allowed.</p> </note>

<ul>
<li>An arc is a connection between two nodes</li>
<li>An <code>xlink:arc</code> element</li>
<li>An element of any type  that has an <code>xlink:type</code> attribute with the value <code>arc</code></li>
<li>The <code>from</code> attribute tells you the origin of the arc</li>
<li>The <code>to</code> attribute tells you the destination of the arc</li>
</ul>

</slide>

<slide>
<title>xlink:arc</title>

<note>
<p>Each explicit <code>xlink:arc</code> element has a <code>from</code> attribute and a <code>to</code> attribute. The values of these attributes are the IDs of the locator element in the extended link from which traversal is initiated and to which the traversal goes. </p>

</note>


<pre><code>&lt;?xml version="1.0"?&gt;
&lt;WEBSITE&gt;
  &lt;xlink:extended 
    xmlns:xlink="http://www.w3.org/XML/XLink/0.9"&gt;
    &lt;xlink:locator href="http://metalab.unc.edu/javafaq/" 
      ID="us"&gt;
      &lt;HOMESITE&gt;North Carolina&lt;/HOMESITE&gt;
    &lt;/xlink:locator&gt;
    &lt;xlink:locator href="http://sunsite.kth.se/javafaq" 
      ID="se"&gt;
      &lt;MIRROR&gt;Sweden&lt;/MIRROR&gt;
    &lt;/xlink:locator&gt;
    &lt;xlink:locator 
      href="http://sunsite.uakom.sk/javafaq/" ID="sk"&gt;
      &lt;MIRROR&gt;Slovakia&lt;/MIRROR&gt;
    &lt;/xlink:locator&gt;
    &lt;xlink:locator 
      href="http://sunsite.cnlab-switch.ch/javafaq/"
      ID="ch"&gt;
      &lt;MIRROR&gt;Switzerland&lt;/MIRROR&gt;
    &lt;/xlink:locator&gt;
    &lt;xlink:arc from="us" to="ch"/&gt;
    &lt;xlink:arc from="us" to="us"/&gt;
    &lt;xlink:arc from="us" to="se"/&gt;
    &lt;xlink:arc from="us" to="sk"/&gt;
  &lt;/xlink:extended&gt;
&lt;/WEBSITE&gt;</code>
</pre>

</slide>

<slide>
<title>Arc Traversal Behavior</title>

<note>
<p>Each of these possible traversals between locations can have different rules for when the link is traversed and what happens when it's traversed. These rules are specified by attaching <code>actuate</code> and <code>show</code> attributes to arc <code>xlink:arc</code> elements or <code>xlink:actuate</code> and <code>xlink:show</code> attributes to arc elements of arbitrary type. These attributes have the same values and meanings as they do for simple links. </p>
</note>

<ul>
<li><code>actuate</code> or <code>xlink:actuate</code></li>
<li><code>show</code> or <code>xlink:show</code></li>
<li><code>showdefault</code></li>
<li><code>actuatedefault</code> </li>
</ul>

</slide>

<slide>
<title>show, actuate, actuatedefault, showdefault</title>


<note>
<p>As the number of locator nodes increases, the number of possible traversals grows more than exponentially fast. Consequently, you don't want to have to attach these attributes to all possible traversals. Therefore, the extended link element can have <code>showdefault</code> and <code>actuatedefault</code> or (<code>xlink:showdefault</code> and <code>xlink:actuatedefault</code>) attributes. These provide default values for the <code>show</code> and <code>actuate</code> attributes of any locator child element that doesn't provide its own values.</p>
</note>


<pre><code>&lt;?xml version="1.0"?&gt;
&lt;WEBSITE&gt;
  &lt;xlink:extended 
    xmlns:xlink="http://www.w3.org/XML/XLink/0.9"
    showdefault="replace" actuatedefault="user"&gt;
    &lt;xlink:locator href="http://metalab.unc.edu/javafaq/" 
                      ID="us"&gt;
      &lt;HOMESITE&gt;North Carolina&lt;/HOMESITE&gt;
    &lt;/xlink:locator&gt;
    &lt;xlink:locator href="http://sunsite.kth.se/javafaq" 
                      ID="se"&gt;
      &lt;MIRROR&gt;Sweden&lt;/MIRROR&gt;
    &lt;/xlink:locator&gt;
    &lt;xlink:locator 
      href="http://sunsite.uakom.sk/javafaq/" ID="sk"&gt;
      &lt;MIRROR&gt;Slovakia&lt;/MIRROR&gt;
    &lt;/xlink:locator&gt;
    &lt;xlink:locator 
      href="http://sunsite.cnlab-switch.ch/javafaq/" 
      ID="ch"&gt;
      &lt;MIRROR&gt;Switzerland&lt;/MIRROR&gt;
    &lt;/xlink:locator&gt;
    &lt;xlink:arc from="us" to="us" show="new"/&gt;
  &lt;/xlink:extended&gt;
&lt;/WEBSITE&gt;</code>
</pre>

</slide>

<slide>
<title>xlink:show, xlink:actuate, xlink:actuatedefault, xlink:showdefault</title>

<note>
<p>To use the <code>WEBSITE</code>, <code>HOMESITE</code>, and <code>MIRROR</code> elements themselves as linking elements, we just need to add the necessary <code>ID</code> attributes and the <code>xlink:</code> prefix and define one new tag for the arc element whose <code>xlink:type</code> is arc.</p>
</note>

<pre><code>&lt;?xml version="1.0"?&gt;
&lt;WEBSITE xmlns:xlink="http://www.w3.org/XML/XLink/0.9"
         xlink:type="extended" xlink:actuatedefault="user"
         xlink:showdefault="replace"&gt;
  &lt;HOMESITE xlink:type="locator" ID="us"
            xlink:href="http://metalab.unc.edu/javafaq/"&gt;
    North Carolina
  &lt;/HOMESITE&gt;
  &lt;MIRROR xlink:type="locator" ID="se"
          xlink:href="http://sunsite.kth.se/javafaq"&gt;
    Sweden
  &lt;/MIRROR&gt;
  &lt;MIRROR xlink:type="locator" ID="sk"
          xlink:title="Cafe au Lait Slovakian Mirror"
          xlink:href="http://sunsite.uakom.sk/javafaq/"&gt;
    Slovakia
  &lt;/MIRROR&gt;
  &lt;MIRROR xlink:type="locator" ID="ch"
    xlink:title="Cafe au Lait Swiss Mirror"
    xlink:href="http://sunsite.cnlab-switch.ch/javafaq/"&gt;
    Switzerland
  &lt;/MIRROR&gt;
  &lt;CONNECTION xlink:type="arc" 
         xlink:from="us" xlink:to="us" xlink:show="new"/&gt;
&lt;/WEBSITE&gt;</code>
</pre>

</slide>

<slide>
<title>Declarations for Extended Link Attributes</title>

<note>
<p>As usual, if the document has a DTD, then to be valid all the attributes and elements must be fully declared. For example, here's a DTD fragment that describes the above <code>WEBSITE</code> element:</p>
</note>

<pre><code>&lt;!ELEMENT WEBSITE (HOMESITE, MIRROR*, CONNECTION*) &gt;
&lt;!ATTLIST WEBSITE
  xmlns:xlink CDATA #FIXED "http://www.w3.org/XML/XLink/0.9"
  xlink:type (simple|extended|locator|arc) #FIXED "extended"
  xlink:title CDATA #IMPLIED
  xlink:role  CDATA #IMPLIED
  xlink:showdefault (new | replace | parsed) #IMPLIED 
                                                 "replace"
  xlink:actuatedefault (user | auto)         #IMPLIED "user"
&gt;

&lt;!ELEMENT HOMESITE (#PCDATA)&gt;
&lt;!ATTLIST HOMESITE
   ID              ID                       #REQUIRED
   xlink:type (simple|extended|locator|arc) #FIXED "locator"
   xlink:href      CDATA                    #REQUIRED
   xlink:role      CDATA                    #IMPLIED
   xlink:title     CDATA                    #IMPLIED
&gt;

&lt;!ELEMENT MIRROR (#PCDATA)&gt;
&lt;!ATTLIST MIRROR
   ID              ID                       #REQUIRED
   xlink:type (simple|extended|locator|arc) #FIXED "locator"
   xlink:href      CDATA                    #REQUIRED
   xlink:role      CDATA                    #IMPLIED
   xlink:title     CDATA                    #IMPLIED
&gt;

&lt;!ELEMENT CONNECTION EMPTY&gt;
&lt;!ATTLIST CONNECTION
  xlink:type  (simple|extended|locator|arc) #FIXED  "arc"
  xlink:from    IDREF                       #REQUIRED
  xlink:to      IDREF                       #REQUIRED
  xlink:show    (new | replace | parsed)  #IMPLIED "replace"
  xlink:actuate (user | auto)               #IMPLIED "user"
&gt;
</code></pre>
</slide>

<slide>
<title>Out-of-Line Links and Extended Link Groups</title>

<note>
<p>Inline links, such as the familiar <code>A</code> element from HTML, are themselves part of the source or target of the link. Generally they link from the document they're part of to some other document. However, they can also link to a different part of the same document. Most simple links are inline. </p>

<p>XLinks, particularly extended links, can also be out-of-line. An out-of-line link is not part of any of the documents it connects. Instead, the links are stored in a separate linking document. For example, this might be useful to maintain a slide show where each slide requires next and previous links. By changing the order of the slides in the linking document, you can change the targets of the previous and next links on each page without having to edit the slides themselves.</p>

<p>Out of line links also allow you to add links to and from documents that can't be modified. For instance, out-of-line links might allow a third party to add links to a page it doesn't control. For instance, Fairness and Accuracy in Reporting (FAIR) or Accuracy in Media (AIM) could put out-of-line links from the New York Times editorial page to analyses of those editorials. The links would be visible only to users who loaded the extended link group document from FAIR or AIM's own site, however; and which links you saw would 
depend on which document you loaded. </p>

<p>And out of line links allow you to add links to different parts of non-XML content. For instance, you could link to the third minute of a QuickTime movie, even though the movie doesn't contain any attributes or elements that would normally be used to identify the linked position. </p>

<p>This expands the abstraction of style sheets into the linking domain. A style sheet is completely separate from the document it describes and yet provides rules that modify how the document is presented to the reader. A linking document containing out-of-line links is separated from the documents it connects, yet it provides the necessary links to the reader. This has several advantages, including keeping more presentation-oriented markup separate from the document and allowing the linking of read-only documents.</p>

<p>Style sheets are <i>much</i> farther along than out-of-line links. There currently is no general proposal for how you attach "link sheets" to XML documents, much less how you decide which individual elements in a document are associated with which links.</p>

<p>One obvious choice is to add an <code>&lt;?xml-linksheet?&gt;</code> processing instruction to a document's prolog to specify where the links are found. The link sheet itself could use something akin to XSL select patterns to map links to individual XML elements. The selectors could even become the value of the <code>locator</code> element's <code>role</code> attribute.</p>

</note>

<ul>

<li>An inline link is part of one of the documents it connects</li>
<li>An out-of-line link may be in a completely different document</li>
<li>Out-of-line links let you connect read-only documents</li>
<li>Out-of-line links let you connect non-XML content</li>
<li>Out-of-line links are mostly theoretical</li>
</ul>

</slide>
<slide>
  <title>Extended Link Group Syntax</title>

<note><p>An extended link group element contains a list of links that connect a particular group of documents. Each document in the group is targeted by means of an extended link document element. It is the application's responsibility to understand how to activate and understand the connections between the group members.</p>

<p>I feel compelled to note that application support for link groups is at best hypothetical at the time of this writing. Although I can show you how to write such links, their actual implementation and support likely is some time away. Some of the details remain to be defined and likely will be implemented in vendor-specific fashions, at least initially. Still, they hold the promise of enabling more sophisticated linking than can be achieved with HTML.</p>

</note>

<ul>
<li><p>An extended link group element contains a list of links that connect a particular group of documents.</p>
<ul>
<li>An <code>xlink:group</code> element</li>
<li>an element with an <code>xlink:type</code> attribute with the value <code>group</code></li>
</ul>
</li>
<li> <p>Each document in the group is represented by an extended link document element.</p>
<ul>
<li><code>xlink:document</code></li>
<li>an element with an <code>xlink:type</code> attribute with the value <code>document</code></li>
</ul>
</li>
<li>The document element has an <code>href</code> or <code>xlink:href</code> attribute whose value is a URL.</li> 
</ul>

<note>
<p>An extended link group element is either an explicit <code>xlink:group</code> element or an element with an <code>xlink:type</code> attribute with the value group. An extended link document element is either an explicit <code>xlink:document</code> element or an element with an <code>xlink:type</code> attribute with the value document. The document element has an <code>href</code> or <code>xlink:href</code> attribute whose value is a URI identifying a member of the group. </p>
</note>
</slide>


<slide>
<title>Extended Link Example</title>

<note> <p>For example, I've put the notes for a Java course I teach on my Web 
site. This particular course consists of 13 classes, each of which contains 
between 30 and 60 individual pages of notes. A table of contents is then 
provided for each class. Each of the several hundred pages making up the entire 
site has links to the previous document (Previous link), the next document (Next 
link), and the table of contents (Top link) for the week. Putting it all 
together, this amounts to more than a thousand interconnections among this set 
of documents.</p> </note>

<!-- Use document???? instead -->
<img src="1601.gif" width="80%" height="80%" border="0"/>

</slide>


<slide>
<title>Extended Link Example</title>


<img src="1602.gif" width="80%" height="80%" border="0"/>

<note>
<p>The possible interconnections grow exponentially with the number of documents. Every time a single document is moved, renamed, or divided into smaller pieces, the links need to be adjusted on that page, on the page before it and after it in the set, and on the table of contents for the week. Quite frankly, this is a lot more work than it should be, and it tends to discourage necessary modifications and updates to the course notes.</p>
</note>
</slide>


<slide>
<title>Extended Link Example</title>


<note>
<p>The sensible thing to do, if HTML supported it, would be to store the connections in a separate document. Reorganization of the pages then could be performed by editing that one document. HTML links don't support this, but XLinks do. Instead of storing the links inline in HTML files, they can be stored out-of-line in group elements. </p>
</note>

<pre><code>&lt;?xml version="1.0"?&gt;
&lt;xlink:group xmlns:xlink="http://www.w3.org/XML/XLink/0.9"&gt;
  &lt;xlink:document href="week1/index.xml"/&gt;
  &lt;xlink:document href="week2/index.xml"/&gt;
  &lt;xlink:document href="week3/index.xml"/&gt;
  &lt;xlink:document href="week4/index.xml"/&gt;
  &lt;xlink:document href="week5/index.xml"/&gt;
  &lt;xlink:document href="week6/index.xml"/&gt;
  &lt;xlink:document href="week7/index.xml"/&gt;
  &lt;xlink:document href="week8/index.xml"/&gt;
  &lt;xlink:document href="week9/index.xml"/&gt;
  &lt;xlink:document href="week10/index.xml"/&gt; 
  &lt;xlink:document href="week11/index.xml"/&gt; 
  &lt;xlink:document href="week12/index.xml"/&gt;
  &lt;xlink:document href="week13/index.xml"/&gt;
&lt;/xlink:group&gt;</code>
</pre>

<note>
<p>This defines an extended link group, which consists of 
13 extended link document elements, each of which refers 
to the index page for one of the classes. </p>
</note>

</slide>


<slide>
<title>Or, Using Attribute Syntax</title>

<note>
The same document 
could be written like this  instead by making heavier use of attributes:
</note>

<pre><code>&lt;?xml version="1.0"?&gt;
&lt;COURSE xmlns:xlink="http://www.w3.org/XML/XLink/0.9"
         xlink:type="group"&gt;
  &lt;CLASS xlink:type="document" xlink:href="week1/index.xml"/&gt;
  &lt;CLASS xlink:type="document" xlink:href="week2/index.xml"/&gt;
  &lt;CLASS xlink:type="document" xlink:href="week3/index.xml"/&gt;
  &lt;CLASS xlink:type="document" xlink:href="week4/index.xml"/&gt;
  &lt;CLASS xlink:type="document" xlink:href="week5/index.xml"/&gt;
  &lt;CLASS xlink:type="document" xlink:href="week6/index.xml"/&gt;
  &lt;CLASS xlink:type="document" xlink:href="week7/index.xml"/&gt;
  &lt;CLASS xlink:type="document" xlink:href="week8/index.xml"/&gt;
  &lt;CLASS xlink:type="document" xlink:href="week9/index.xml"/&gt;
  &lt;CLASS xlink:type="document" xlink:href="week10/index.xml"/&gt; 
  &lt;CLASS xlink:type="document" xlink:href="week11/index.xml"/&gt; 
  &lt;CLASS xlink:type="document" xlink:href="week12/index.xml"/&gt;
  &lt;CLASS xlink:type="document" xlink:href="week13/index.xml"/&gt;
&lt;/COURSE&gt;</code>
</pre>

<note>
<p>As always, if these documents are to 
be valid all these elements and attributes must be declared correctly in the DTD.</p>
</note>
</slide>

<slide>
<title>XLink Summary</title>

<ul>
<li>XLinks can do everything HTML links can do and quite a bit more, but they aren't supported by current applications.</li>
<li>XLink elements of all types are placed in the http://www.w3.org/XML/XLink/0.9 namespace, normally with the <code>xlink</code> prefix. However, the URI is likely to change in future revisions to XLink. </li>
<li>Simple links behave much like HTML links, but they are not restricted to a single <code>&lt;A&gt;</code> tag.</li>
<li>Link elements are identified by <code>xlink:type</code> attributes.</li>
<li>Simple link elements are identified by <code>xlink:type</code> attributes with the value simple. The <code>xlink:simple</code> element is also a simple link.</li>
<li>Link elements can describe the resource they're linking to with <code>title</code> and <code>role</code> attributes.</li>
<li>Link elements can use the <code>show</code> attribute to tell the application how the content should be displayed when the link is activated, for example, by opening a new window.</li>
<li>Link elements can use the <code>actuate</code> attribute to tell the application whether the link should be traversed without a specific user request.</li>
<li>Extended link elements are identified by <code>xlink:type</code> attributes with the value extended. The <code>xlink:extended</code> element is also an extended link.</li>
<li>Extended links can contain multiple locators and arcs. Currently, it's left to the application to decide how to choose between different alternatives.</li>
<li>Locator elements are identified by <code>xlink:type</code> attributes with the value locator. The <code>xlink:locator</code> element is also a locator element.</li>
<li>A locator element has an <code>href</code> or <code>xlink:href</code> attribute whose value is the URI of the resource it locates.</li>
<li>Arc elements are identified by <code>xlink:type</code> attributes with the value arc. The <code>xlink:arc</code> element is also an arc element.</li>
<li>Arc elements have <code>from</code> and <code>to</code> attributes of <code>IDREF</code> type that identify to the locator elements they connect.</li>
<li>Arc elements may have <code>show</code> and <code>actuate</code> attributes to determine when and how traversal of the link occurs.</li>
<li>An extended link group element contains a list of links that connect a particular group of documents.</li>
<li>An extended link group element is identified by an <code>xlink:type</code> attribute with the value group. An <code>xlink:group</code> element is also an extended link group element.</li>
<li>An out of line link is an XLink (most commonly an extended XLink) that is not part of any of the documents it connects. Instead, the links are stored in a separate linking document.</li>
<li>An extended link document element is identified by an <code>xlink:type</code> attribute with the value document. An <code>xlink:document</code> element is also an extended link document element.</li>
<li>Each extended link document element has an <code>href</code> or <code>xlink:href</code> attribute whose value is the URI of the document.</li>
</ul>
</slide>


<slide>
  <title>XPointers</title>


<ul>
<li>Why use XPointers?</li>
<li>XPointer examples</li>
<li>Absolute location steps</li>
<li>Relative location steps</li>
<li>Node Tests</li>
<li>Predicates</li>
<li>String location terms</li>
<li>Ranges</li>
<li>Tumblers</li>
</ul>

</slide>


<slide>
<title>What are XPointers?</title>

<p>XPointer, the XML Pointer Language, defines an addressing scheme for individual parts of an XML document. XLinks point to a URI (in practice, a URL) that specifies a particular resource. The URI may include an XPointer part that more specifically identifies the desired part or element of the targeted resource or document. XPointers use the same XPath syntax you're familiar with from XSL transformations to identify the parts of the document they point to, along with a few additional pieces.</p>

</slide>

<slide>
<title>Why Use XPointers?</title>

<note>
<p>URLs are simple and easy to use, but they're also quite limited. For one thing, a URL only points at a single, complete document. More granularity than that, such as linking to the third sentence of the 17th paragraph in a document, requires the author of the targeted document to manually insert named anchors at the targeted location. The author of the document doing the linking can't do this unless he or she also has write access to the document being linked to. Even if the author doing the linking can insert named anchors into the targeted document, it's almost always inconvenient.</p>
</note>

Address specific elements or groups of elements in a document
<ul>
<li>The element with a given ID</li>
<li>All elements that possess a certain attribute</li>
<li>The first element of a certain type</li>
<li>The last element whose <code>class</code> attribute has the value <code>pending</code>.</li>
<li>The seventh element of a given type</li>
<li>The first child of the seventh element</li>
<li>and many more including combinations of these addresses...</li>
</ul>

<note>
<p>It would be more useful to be able to link to a particular element or group of elements on a page without having to change the document you're linking to. For example, given a large page such as the complete baseball statistics of Chapters 4 and 5, you might want to link to only one team or one player. There are several parts to this problem. The first part is addressing the individual elements. This is the part that XPointers solve. XPointers allow you to target a given element by number, name, type, or relation to other elements in the document.</p>
</note>
</slide>

<slide>
<title>Three Problems to Solve</title>

<ol>
<li>Addressing arbitrary parts of a document in a robust fashion</li>
<li>How do Web browsers and Web servers communicate these addresses?</li>
<li>Do parts of XML documents make sense out of context?</li>
</ol>

<note>
<p>The second part of the problem is the protocol by which a browser asks a Web server to send only part of a document rather than the whole thing. This is an area of active research. More work is needed. XPointers do little to solve this problem, except for providing a foundation on which such systems can build. For instance, the best effort to date are the so-called &quot;byte range extensions to HTTP&quot; available in HTTP 1.1. So far these have not achieved widespread adoption, mostly because Web authors aren't comfortable specifying a byte range in a document. Furthermore, byte ranges are extremely fragile. Trivial edits to a document, even simple reformatting, can destroy byte range links. HTTP 1.1 does allow other range units besides raw bytes (for example, XML elements), but does not require Web servers or browsers to support such units. Much work remains to be done.</p>

<p>The third part of the problem is making sure that the retrieved document makes sense without the rest of the document to go along with it. In the context of XML, this effectively means the linked part is well-formed or perhaps valid. This is a tricky proposition, because most XML documents, especially ones with nontrivial prologs, don't decompose well. Again, XPointers don't address this. The W3C XML Fragment Working Group is addressing this issue, but the work is only just beginning.</p>

<p>For the moment, therefore, an XPointer can be used as an index into a complete document, the whole of which is loaded and then positioned at the location identified by the XPointer. In the long-term, extensions to both XML, XLink, HTTP, and other protocols may allow more sophisticated uses of XPointers. For instance, you might be able to quote a remote document by including only an XLink with an XPointer to the paragraph you want to quote, rather than retyping the text of the quote. You could include cross references inside a document that automatically update themselves as the document is revised. These uses, however, will have to wait for the development of several next-generation technologies. For now, we must be content with precisely identifying the part of a document we want to jump to when following an XLink.</p>
</note>
</slide>

<slide>
<title>Named Anchors are HTML's solution</title>

<note>
<p>HTML links generally point to a particular document. Additional granularity, that is, pointing to a particular section, chapter, or paragraph of a particular document, isn't well-supported. Provided you control both the linking and the linked document, you can insert a named anchor into an HTML file at the position to which you want to link. For example:</p>
</note>


<pre><code>&lt;H2&gt;&lt;A NAME="xpointers"&gt;XPointers&lt;/A&gt;&lt;/H2&gt;
</code></pre>

<p>You can then link to this particular position in the file by adding a <code>#</code> and the name of the anchor into the link. For example, in a table of contents you might see:</p>

<pre><code>&lt;A HREF="#xpointers"&gt;XPointers&lt;/A&gt;
</code></pre>

<note>
<p>In practice, this solution is kludgy. It's not always possible to modify the target document so the source can link to it. The target document may be on a different server controlled by someone other than the author of the source document. And the author of the target document may change or move it without notifying the author of the source.</p>

<p>Furthermore, named anchors violate the principle of separating markup from content. Placing a named anchor in a document says nothing about the document or its content. It's just a marker for other documents to refer to. It adds nothing to the document's own content.</p>
</note>
</slide>

<slide>
<title>XPointer Examples</title>

<note>
<p>XLinks allow much more sophisticated connections between documents through the use of XPointers. An XPointer can refer to a particular element of a document; to the first, second, or 17th such element; to the first element that's a child of a given element; and so on. XPointers provide extremely powerful connections between documents. They do not require the targeted document to contain additional markup just so its individual pieces can be linked to.</p>

<p>Furthermore, unlike HTML anchors, XPointers don't point to just a single point in a document. They can point to ranges or spans. Thus, you can use an XPointer to select a particular part of a document, perhaps so it can be copied or loaded into a program.</p>

<p>Here are a few examples of XPointers:</p>
</note>


<code>
<p>xptr(id("ebnf"))</p>
<p>xptr(descendant::language[position()=2])</p>
<p>ebnf</p>
<p>xptr(/child::spec/child::body/child::*/child::language[ position()=2])</p>
<p>/1/14/2</p>
<p>xptr(id("ebnf"))xptr(id("EBNF"))</p>
</code>

<note>
<p>
Each of these selects a particular element in a document. The first finds the element with the ID "ebnf". The second finds the first <code>language</code> element in the document that's the second child of its parent. The third is a shorthand form of finding the element with the ID "ebnf". The fourth finds the second <code>language</code> child element of any
child  element of the first <code>body</code> element of the <code>spec</code> child of the root node. The fifth finds the second child element of the fourteenth child element of the first child element of the root element. The final URI also points to the element with the ID "ebnf"; However, if no
such element is present then it finds the element with the ID "EBNF".</p>
</note>
</slide>

<slide>
<title>URIs with XPointers</title>

<note>
<p>
The document is not specified in the XPointer; rather, the XLink specifies the document. The XLinks you saw in the previous chapter did not contain XPointers, but it isn't hard to add XPointers to them. Most of the time you simply append the XPointer to the URI separated by a <code>#</code>, just as you do with named anchors in HTML. For example, the above list of XPointers could be suffixed to URLs and come out looking like the following:</p>
</note>

<ul>
<li>XPointer does not specify the document, only the part of the document</li>
<li>The rest of the URL specifies the document</li>
</ul>


<code>
<p>http://www.w3.org/TR/1998/REC-xml-19980210.xml#xptr(id("ebnf"))</p>
<p>http://www.w3.org/TR/1998/REC-xml-
19980210.xml#xptr(descendant::language[position()=2])</p>
<p>http://www.w3.org/TR/1998/REC-xml-19980210.xml#ebnf</p>
<p>http://www.w3.org/TR/1998/REC-xml-19980210.xml
#xptr(/child::spec/child::body/child::*/child::language[ position() = 2])</p>
<p>http://www.w3.org/TR/1998/REC-xml-
19980210.xml#/1/14/2</p>
<p>http://www.w3.org/TR/1998/REC-xml-
19980210.xml#xptr(id("ebnf"))xptr(id("EBNF"))</p>
</code>

<p>In fact, these URIs are just six different ways of pointing to the same element of the document at http://www.w3.org/TR/1998/REC-xml-19980210.xml.</p>

</slide>

<slide>
<title>XLinks with XPointers</title>


<p>
Normally the URI with an XPointer part is the value 
of the <code>href</code> attribute of a <code>locator</code> element. For example:</p>

<pre><code>&lt;locator href = 
  "http://www.w3.org/TR/1998/REC-xml-19980210.xml
#xptr(id(&apos;ebnf&apos;))" &gt;
  Extensible Markup Language (XML) 1.0
&lt;/locator&gt;
</code></pre>


</slide>

<slide>
<title>Document Fragments</title>

<p>You can use a vertical bar (<code>|</code>) instead of a <code>#</code> to indicate that you do not want the entire document. Instead, you want only the part of the document referenced by the XPointer. For example:</p>

<code>
<p>http://www.w3.org/TR/1998/REC-xml-
19980210.xml|xptr(id("ebnf"))</p>
<p>http://www.w3.org/TR/1998/REC-xml-
19980210.xml|xptr(descendant::language[position()=2])</p>
<p>http://www.w3.org/TR/1998/REC-xml-19980210.xml|ebnf</p>
<p>http://www.w3.org/TR/1998/REC-xml-
19980210.xml|
xptr(/child::spec/child::body/child::*/child::language[ position() = 2])</p>
<p>http://www.w3.org/TR/1998/REC-xml-
19980210.xml|/1/14/2</p>
<p>http://www.w3.org/TR/1998/REC-xml-
19980210.xml|xptr(id("ebnf"))xptr(id("EBNF"))</p>
</code>

<note>
<p>Whether the client is able to retrieve only a piece of the document is protocol dependent. Most current Web browsers and servers aren't able to handle the sophisticated requests that these XPointers imply. However, this can be useful for custom protocols that use XML as an underlying transport mechanism.</p>
</note>
</slide>

<slide>
<title>A Concrete Example</title>

<note>To demonstrate the different types of XPointers, it's useful to have a concrete example in mind. Listing 17-1 is a simple, valid document that should be self-explanatory. It contains information about two related families and their members. The root element is <code>FAMILYTREE</code>. A <code>FAMILYTREE</code> can contain <code>PERSON</code> and <code>FAMILY</code> elements. Each <code>PERSON</code> and <code>FAMILY</code> element has a required <code>ID</code> attribute. Persons contain a name, birth date, and death date. Families contain a husband, a wife, and zero or more children. The individual persons are referred to from the family by reference to their IDs. Any child element may be omitted from any element.</note>

<pre><code>&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE FAMILYTREE [

  &lt;!ELEMENT FAMILYTREE (PERSON | FAMILY)*&gt;

  &lt;!-- PERSON elements --&gt; 
  &lt;!ELEMENT PERSON (NAME*, BORN*, DIED*, SPOUSE*)&gt;
  &lt;!ATTLIST PERSON 
    ID      ID     #REQUIRED
    FATHER  CDATA  #IMPLIED
    MOTHER  CDATA  #IMPLIED
  &gt;
  &lt;!ELEMENT NAME (#PCDATA)&gt;
  &lt;!ELEMENT BORN (#PCDATA)&gt;
  &lt;!ELEMENT DIED  (#PCDATA)&gt;
  &lt;!ELEMENT SPOUSE EMPTY&gt;
  &lt;!ATTLIST SPOUSE IDREF IDREF #REQUIRED&gt;
  
  &lt;!--FAMILY--&gt; 
  &lt;!ELEMENT FAMILY (HUSBAND?, WIFE?, CHILD*) &gt;
  &lt;!ATTLIST FAMILY ID ID #REQUIRED&gt;
  
  &lt;!ELEMENT HUSBAND EMPTY&gt;
  &lt;!ATTLIST HUSBAND IDREF IDREF #REQUIRED&gt;
  &lt;!ELEMENT WIFE EMPTY&gt;
  &lt;!ATTLIST WIFE IDREF IDREF #REQUIRED&gt;
  &lt;!ELEMENT CHILD EMPTY&gt;
  &lt;!ATTLIST CHILD IDREF IDREF #REQUIRED&gt;

]&gt;
&lt;FAMILYTREE&gt;

  &lt;PERSON ID="p1"&gt;
    &lt;NAME&gt;Domeniquette Celeste Baudean&lt;/NAME&gt;
    &lt;BORN&gt;11 Feb 1858&lt;/BORN&gt;
    &lt;DIED&gt;12 Apr 1898&lt;/DIED&gt;
    &lt;SPOUSE IDREF="p2"/&gt;
  &lt;/PERSON&gt;

  &lt;PERSON ID="p2"&gt;
    &lt;NAME&gt;Jean Francois Bellau&lt;/NAME&gt;
    &lt;SPOUSE IDREF="p1"/&gt;
  &lt;/PERSON&gt;

  &lt;PERSON ID="p3" FATHER="p2" MOTHER="p1"&gt;
    &lt;NAME&gt;Elodie Bellau&lt;/NAME&gt;
    &lt;BORN&gt;11 Feb 1858&lt;/BORN&gt;
    &lt;DIED&gt;12 Apr 1898&lt;/DIED&gt;
    &lt;SPOUSE IDREF="p4"/&gt;
  &lt;/PERSON&gt;

  &lt;PERSON ID="p4" FATHER="p2" MOTHER="p1"&gt;
    &lt;NAME&gt;John P. Muller&lt;/NAME&gt;
    &lt;SPOUSE IDREF="p3"/&gt;
  &lt;/PERSON&gt;

  &lt;PERSON ID="p7"&gt;
    &lt;NAME&gt;Adolf Eno&lt;/NAME&gt;
    &lt;SPOUSE IDREF="p6"/&gt;
  &lt;/PERSON&gt;

  &lt;PERSON ID="p6" FATHER="p2" MOTHER="p1"&gt;
    &lt;NAME&gt;Maria Bellau&lt;/NAME&gt;
    &lt;SPOUSE IDREF="p7"/&gt;
  &lt;/PERSON&gt;

  &lt;PERSON ID="p5" FATHER="p2" MOTHER="p1"&gt;
    &lt;NAME&gt;Eugene Bellau&lt;/NAME&gt;
  &lt;/PERSON&gt;

  &lt;PERSON ID="p8" FATHER="p2" MOTHER="p1"&gt;
    &lt;NAME&gt;Louise Pauline Bellau&lt;/NAME&gt;
    &lt;BORN&gt;29 Oct 1868&lt;/BORN&gt;
    &lt;DIED&gt;3 May 1938&lt;/DIED&gt;
    &lt;SPOUSE IDREF="p9"/&gt;
  &lt;/PERSON&gt;

  &lt;PERSON ID="p9"&gt;
    &lt;NAME&gt;Charles Walter Harold&lt;/NAME&gt;
    &lt;BORN&gt;about 1861&lt;/BORN&gt;
    &lt;DIED&gt;about 1938&lt;/DIED&gt;
    &lt;SPOUSE IDREF="p8"/&gt;
  &lt;/PERSON&gt;

  &lt;PERSON ID="p10" FATHER="p2" MOTHER="p1"&gt;
    &lt;NAME&gt;Victor Joseph Bellau&lt;/NAME&gt;
    &lt;SPOUSE IDREF="p11"/&gt;
  &lt;/PERSON&gt;

  &lt;PERSON ID="p11"&gt;
    &lt;NAME&gt;Ellen Gilmore&lt;/NAME&gt;
    &lt;SPOUSE IDREF="p10"/&gt;
  &lt;/PERSON&gt;

  &lt;PERSON ID="p12" FATHER="p2" MOTHER="p1"&gt;
    &lt;NAME&gt;Honore Bellau&lt;/NAME&gt;
  &lt;/PERSON&gt;

  &lt;FAMILY ID="f1"&gt;
    &lt;HUSBAND IDREF="p2"/&gt;
    &lt;WIFE IDREF="p1"/&gt;
    &lt;CHILD IDREF="p3"/&gt;
    &lt;CHILD IDREF="p5"/&gt;
    &lt;CHILD IDREF="p6"/&gt;
    &lt;CHILD IDREF="p8"/&gt;
    &lt;CHILD IDREF="p10"/&gt;
    &lt;CHILD IDREF="p12"/&gt;
  &lt;/FAMILY&gt;

  &lt;FAMILY ID="f2"&gt;
    &lt;HUSBAND IDREF="p7"/&gt;
    &lt;WIFE IDREF="p6"/&gt;
  &lt;/FAMILY&gt;

&lt;/FAMILYTREE&gt;
</code></pre>

<note>In sections that follow, this document is assumed to be present at the URL <code>http://www.harolds.net/genealogy.xml</code>. This isn't a real URL, but the emphasis here is on selecting individual parts of a document rather than a document as a whole.</note>
</slide>

<slide>
<title>Location Steps</title>


<ul>
<li>XPointers are built from <i>location steps</i>.</li> 
<li>Each location step specifies a point in the targeted document, generally relative to some other well-known point such as the start of the document or another location step. </li>
<li>The type of location step is given by a keyword such as <code>id</code>, <code>ancestor</code>, or <code>child</code>.</li>
</ul>

</slide>

<slide>
<title>Absolute Location Steps</title>

<P>
There are two absolute location steps:
</P>

<ul>
<li><code>id()</code></li>
<li>the root <code>/</code></li>
</ul>

</slide>

<slide>

<title>id()</title>

<note>The <code>id()</code> function is one of the simplest and most useful location steps. It selects the element in the document that has an <code>ID</code> type attribute with a specified value. 
</note>

<p>
 URI:</p> 
 
 <p><code>http://www.harolds.net/genealogy.xml#xptr(id("p2"))</code></p>

<p>Element:</p>

<pre><code>  &lt;PERSON ID="p2"&gt;
    &lt;NAME&gt;Jean Francois Bellau&lt;/NAME&gt;
    &lt;SPOUSE IDREF="p1"/&gt;
  &lt;/PERSON&gt;
</code></pre>

<note>
<p>Because <code>ID</code> type attributes are unique, you know there aren't other elements that match this XPointer. Therefore, <code>http://www.harolds.net/genealogy.xml#xptr(id("p2"))</code> must refer to Jean Francois Bellau's <code>PERSON</code> element. The XPointer selects the entire element to which it refers, including all its children, not just the start tag.</p>

<p>The disadvantage of the <code>id()</code> location term is that it requires assistance from the targeted document. If the element you want to point to does not have an <code>ID</code> type attribute, you're out of luck. If other elements in the document have <code>ID</code> type attributes, you may be able to point to one of them and use a relative location step (discussed in the next section) to point to the one you really want. Nonetheless, <code>ID</code> type attributes are best when you control both the targeted document and the linking document, so you can ensure that the IDs match the links even as the documents evolve and change over time.</p>

<p>In some cases, such as a document without a DTD, a targeted document may not have any <code>ID</code> type attributes, although it may have attributes named <code>ID</code>. In this case, the application may (or may not) try to guess which element you were pointing at. Generally it selects the first element in the document with an attribute of any type and a name whose value matches the requested <code>ID</code>. On the other hand, the application is free not to select any element.</p>

</note>

</slide>

<slide>

<title>ID shortcut</title>

<p>
Since ID pointers are so common and so useful, there's also a shortcut for this. If all you want to do is point to a particular element with a particular ID, you can skip all the <code>xptr(id("..."))</code> fru-fru and just use the bare ID after the <code>#</code> like this:
</p>

<pre><code>http://www.harolds.net/genealogy.xml#p2</code></pre>

<note><p>
You can only do this is all you want is the particular element with the particular ID. You cannot add additional relative location steps to a URI that uses this shortcut to select children of the element with ID p2 or the third attribute of the element with ID p12. If you want to do that you have to use the full <code>xptr(id("p2"))</code> syntax.
</p>
</note>

</slide>

<slide>

<title> The root /</title>

<note>
<p>
The <code>/</code> location term points to the root node of the document. This is not the same as the root element. Rather it is an abstract node that contains the entire document including the XML declaration, the document type declaration, any comments or processing instructions that come before or after the root element such as <code>xml-stylesheet</code>, and the root element itself.
</p>
</note>

<p>
To select the root node of the XML 1.0 specification at http://www.w3.org/TR/REC-xml you can use this URI:
</p>

<pre><code>http://www.w3.org/TR/REC-xml#xptr(/)
</code></pre>

 <p> <code>/</code> is primarily useful in compound XPointers as a basis 
from which to start. In fact, if no absolute location term is included in a 
compound location term, <code>/</code> is assumed. However, <code>root()</code> 
can also be used to select the entire document in a URI that uses <code>|</code> 
to indicate that only a part is normally loaded. For example:</p> 

<p><code>http://www.w3.org/TR/1999/REC-xml|xptr(/)
</code></p>

</slide>

<slide>
<title>Relative Location Steps</title>

<note>
<p><code>id</code> and <code>/</code> are absolute location paths. Absolute location paths can find a particular element in a document regardless of what else is in the document and where the particular element occurs. However, more commonly you want to find the first element of a given type, the last element of a given type, the first child of a particular type, the next element of a given type, all elements of a given type, or something similar. These tasks are accomplished by attaching relative location steps to an initial absolute location step to form a <i>compound locator</i>. The different location steps are separated by forward slashes (<code>/</code>). The most general XPointer is a single absolute location step followed by any number of relative location steps. Each term in the list is relative to the one that precedes it, except for the first. Terms in the list are separated by slashes.</p>
</note>

<ul>
<li>Adding a relative location step to an initial absolute location step forms a <i>compound locator</i>. </li>

<li>Location steps are separated by forward slashes (<code>/</code>). </li>
</ul>

<note>
<p>The most general XPointer is a single absolute location step followed by any number of relative location steps. Each term in the list is relative to the one that precedes it, except for the first. Terms in the list are separated by slashes.</p>
</note>


</slide>

<slide>
<title>The Parts of a Relative Location Step</title>

<ul>
<li>Context Node(s)</li>
<li>Axis</li>
<li>::</li>
<li>Node Test</li>
<li>Predicate(s)</li>
</ul>

<pre><code>id("p6")/child::NAME[position()=1]
</code></pre>


<note>
<p>A relative location step has an implicit context node (possibly more than one) which defines where the step starts from. In a compound locator, this will be the node or nodes selected by the previous location step. For instance, consider this compound locator:</p>

<p>It begins with the absolute location step <code>id("p6")</code>. This identifies the context node for the following relative location step <code>child::NAME[position()=1]</code>. In 
our example, the context node is thus Maria Bellau's <code>PERSON</code> element. </p>

<p>The first explicit part of the relative location step is the axis which defines the nodes that are selected based on their position relative to the context node. The axis here is <code>child</code>, so all the children of the context node, that is the children of Maria Bellau's <code>PERSON</code> element are selected, specifically her <code>NAME</code> element <code>&lt;NAME&gt;Maria Bellau&lt;/NAME&gt;</code> and her <code>SPOUSE</code> element <code>&lt;SPOUSE IDREF="p7"/&gt;</code>. Other possible axes include <code>ancestor</code>, <code>descendant</code>, <code>self</code>, <code>ancestor-or-self</code>, <code>descendant-or-self</code>, <code>attribute</code>, and more. </p>

<p>The axis is followed by a double colon and a <i>node test</i>. Generally the node test is an element name, but it may also be the asterisk (<code>*</code>) wild card to indicate that any node is to be matched, or one of several functions for selecting comments, text, attributes, and processing instructions. Here the node test is <code>NAME</code> so only <code>NAME</code> elements are selected. Together the axis, the double colon, and the node test are referred to as the <i>basis</i>.</p>

<p>A relative location step must have an axis and a node test. It may or may not have one or more <i>predicates</i>. The predicate is a pair of square brackets containing an expression (exactly like the expressions you learned about in XSL) that further winnows down the nodes selected by the basis. Here the predicate is <code>[position()=1]</code> which says that only the first node in the context node set selected by the basis is pointed at. In this example, that's redundant since the context node set has a single element, Maria Bellau's  <code>NAME</code> element.</p>
</note>
</slide>

<slide>
<title>The Twelve Relative Location Axes</title>

<note>
<p>There are other powerful selection techniques, which are discussed below. In fact, including <code>child</code>, there are twelve relative location axes, all from the same XPath syntax used for XSL transformation. These are listed in Table 17-1. Each serves to select a particular subset of the elements in the document. For instance, the <code>following</code> relative location term selects from elements that come after the source element. The <code>preceding</code> relative location term selects from elements that come before the source element.</p>
</note>

<table border="true" cellspacing="1" cellpadding="7">
<tr><td width="25%" valign="TOP">
<b><font face="Arial" size="3">Axis</font></b></td>
<td width="75%" valign="TOP">
<b><font face="Arial" size="3">Selects From</font></b></td>
</tr>
<tr><td width="25%" valign="TOP">
<code>ancestor</code></td>
<td width="75%" valign="TOP">
the parent of the current node, the parent of the parent of the current node, the parent of the parent of the parent of the current node, and so forth back to the root node</td>
</tr>
<tr><td width="25%" valign="TOP">
<code>ancestor-or-self</code></td>
<td width="75%" valign="TOP">
the ancestors of the current node and the current node itself</td>
</tr>
<tr><td width="25%" valign="TOP">
<code>attribute</code></td>
<td width="75%" valign="TOP">
the attributes of the current node</td>
</tr>
<tr><td width="25%" valign="TOP">
<code>child</code></td>
<td width="75%" valign="TOP">
the immediate children of the current node</td>
</tr>
<tr><td width="25%" valign="TOP">
<code>descendant</code></td>
<td width="75%" valign="TOP">
the children of the current node, the children of the children of the current node, and so forth</td>
</tr>
<tr><td width="25%" valign="TOP">
<code>descendant-or-self</code></td>
<td width="75%" valign="TOP">
the current node itself and its descendants</td>
</tr>
<tr><td width="25%" valign="TOP">
<code>following</code></td>
<td width="75%" valign="TOP">
all nodes that start after the end of the current node, excluding attribute and namespace nodes</td>
</tr>
<tr><td width="25%" valign="TOP">
<code>following-sibling</code></td>
<td width="75%" valign="TOP">
all nodes that start after the end of the current node and have the same parent as the current node</td>
</tr>
<tr><td width="25%" valign="TOP">
<code>parent</code></td>
<td width="75%" valign="TOP">
the single parent node of the current node</td>
</tr>
<tr><td width="25%" valign="TOP">
<code>preceding</code></td>
<td width="75%" valign="TOP">
all nodes that start before the start of the current node, excluding attribute and namespace nodes</td>
</tr>
<tr><td width="25%" valign="TOP">
<code>preceding-sibling</code></td>
<td width="75%" valign="TOP">
all nodes that start before the start of the current node and have the same parent as the current node</td>
</tr>
<tr><td width="25%" valign="TOP">
<code>self</code></td>
<td width="75%" valign="TOP">
the current node</td>
</tr>
</table>

</slide>

<slide>
<title>child</title>

<p>The <code>child</code> axis selects from only the <i>immediate</i> children of the source element. For example, consider this URI:</p>

<pre><code>http://www.harolds.net/genealogy.xml#xptr(id("p1")/child::NAME)
</code></pre>


</slide>

<slide>
<title>descendant</title>

<p>The <code>descendant</code> axis searches through all the descendants of the source, not just the immediate children. </p>


<p><code>/descendant::BORN[position()=3]</code></p>

<note>
<p>
 selects the third <code>BORN</code> element encountered in a depth-first search of the document tree. (Depth first is the order you get if you simply read through the XML document from top to bottom.) In Listing 17-1, that selects Louise Pauline Bellau's birthday, <code>&lt;BORN&gt;29 Oct 1868&lt;/BORN&gt;</code>.</p>
</note>

</slide>

<slide>
<title>descendant-or-self</title>


<p>The <code>descendant-or-self</code> axis searches through all the descendants of the source, starting with the source itself, until it finds the requested element.</p>

<p> <code>id("p3")/descendant-or-self::PERSON</code></p>

<note><p> refers to all <code>PERSON</code> children of the element with ID p3 as well as that element itself, since it is of type <code>PERSON</code>. </p></note>

</slide>

<slide>
<title>parent</title>

<p>The <code>parent</code> axis refers to the node that's the immediate parent of the source.</p>
<p> <code>/descendant::HUSBAND[position()=1]/parent::*</code></p>


<note><p> refers to the parent element of the first <code>HUSBAND</code> element in the document.</p></note>

</slide>

<slide>
<title>self</title>

<p>The <code>self</code> axis refers to the context node. It's sometimes useful when making relative links. </p>

<p><code>/self::node()</code> </p>

<note><p>
selects the root node of the document (which is not the same as the root element of the document; that would be selected by <code>/child::*</code> or, in this example, <code>/child::FAMILYTREE</code>.)</p>
</note>

</slide>

<slide>
<title>ancestor</title>

<p>The <code>ancestor</code> axis selects all nodes that contain the context node, starting with its parent. </p>


<p> <code>/descendant::BORN[position()=2]/ancestor::*[position()=1]</code></p>

<note><p> selects the element which contains the second <code>BORN</code> element. In this example, it selects Elodie Bellau's <code>PERSON</code> element.</p>
</note>

</slide>

<slide>
<title>ancestor-or-self</title>

<p>The <code>ancestor-or-self</code> axis selects the context node and all nodes that contain it.</p>

<p><code>id("p1")/ancestor-or-self::*</code> </p>

<note><p>selects a node set including Domeniquette Celeste Baudean's <code>PERSON</code> element that has ID p1, its parent the <code>FAMILYTREE</code> element, and its parent, the root node. 
</p>
</note>

</slide>

<slide>
<title>preceding</title>

<p>The <code>preceding</code> axis selects all elements that occur before the context node. The <code>preceding</code> axis has no respect for hierarchy. The first time it encounters an element's start tag, end tag, or empty tag, it counts that element. </p>

<pre><code>/descendant::BORN[position()=3]/preceding::*[position()=5]
</code></pre>

<note>
<p>This says go to the third <code>BORN</code> element from the root, Louise Pauline Bellau's birthday, <code>&lt;BORN&gt;29 Oct 1868&lt;/BORN&gt;</code>, and then move back five elements. This lands on Maria Bellau's <code>PERSON</code> element.</p>
</note>

</slide>

<slide>
<title>following</title>

<p>The <code>following</code> axis selects all elements that occur after the context node's closing tag. Like <code>preceding</code>, <code>following</code> has no respect for hierarchy. The first time it encounters an element's start tag or empty tag, it counts that element. </p>

<pre><code>/descendant::BORN[position()=2]/following::*[position()=5]
</code></pre>

<note><p>This says go to Elodie Bellau's birthday, <code>&lt;BORN&gt;11 Feb 1858&lt;/BORN&gt;</code>, and then move forward five elements. This lands on John P. Muller's <code>NAME</code> element, <code>&lt;NAME&gt;John P. Muller&lt;/NAME&gt;</code>, after passing through Elodie Bellau's <code>DIED </code>element, Elodie Bellau's <code>SPOUSE</code> element, Elodie Bellau's <code>PERSON</code> element, and John P. Muller's <code>PERSON</code> element, in this order.</p>
</note>
</slide>

<slide>
<title>preceding-sibling</title>

<p>The <code>preceding-sibling</code> axis selects elements that precede the context node in the same parent element. </p>


<p>
<code>/descendant::BORN[position()=2]/preceding-sibling::*[position() = 1]</code> </p>

<note><p>
selects Elodie Bellau's <code>NAME</code> element, <code>&lt;NAME&gt;Elodie Bellau&lt;/NAME&gt;</code>. <code>/descendant::BORN[position()=2]/preceding-sibling::*[position()=2]</code> doesn't point to anything because there's only one sibling of Elodie Bellau's <code>BORN</code> element before it.</p>
</note>

</slide>

<slide>
<title>following-sibling</title>

<p>The <code>following-sibling</code> axis selects elements that follow the context node in the same parent element. </p>
<p>
<code>/descendant::BORN[position()=2]/following-sibling::*[position() = 1]</code> </p>
<note> <p>selects Elodie Bellau's <code>DIED</code> element, <code>&lt;DIED&gt;12 
Apr 1898&lt;/DIED&gt;</code>. <code>/descendant::BORN[position()=2]/following-
sibling::*[position()=3]</code> doesn't point to anything because there are only 
two sibling elements following Elodie Bellau's <code>BORN</code> element.</p> 
</note>
</slide>

<slide>
<title>attribute</title>

<p>The <code>attribute</code> axis selects an attribute node of the source node. 
</p>

<p> <code>/descendant::SPOUSE/attribute::IDREF</code> </p>

 
 <note><p>selects all <code>IDREF</code> attributes of all <code>SPOUSE</code> 
 elements in the document. For another example, to find all <code>PERSON</code> 
 elements in the document <code>http://www.harolds.net/genealogy.xml</code> 
 whose <code>FATHER</code> attribute is Jean Francois Bellau (ID p2), you could 
 write:</p></note>

<pre><code>/descendant::PERSON[attribute::FATHER="p2"]
</code></pre>

</slide>

<slide>
<title>Node Tests</title>

<p>Most of the time the node test part of the basis is simply an element name like <code>PERSON</code> or <code>BORN</code>. However, there are five other possibilities:</p><ul>

<li><code>*
</code></li>
<li><code>node()</code></li>
<li><code>text()
</code></li><li><code>comment()
</code></li>
<li><code>processing-instruction()
</code></li>
</ul>

</slide>

<slide>
<title>The wild card *</title>


<ul>
<li>An asterisk matches any <em>element</em>. </li>
<li>It does not match comment 
nodes, text nodes, processing instruction nodes, and attribute nodes. </li>
</ul>

<p><code>id("p1")/child::*</code> </p>

<note> <p>selects all the child elements of the element with the ID p1 regardless 
of their type. This does, however, select only element nodes. It omits comment 
nodes, text nodes, processing instruction nodes, and attribute nodes. If you 
want to select absolutely any kind of node use the <code>node()</code> wild card 
instead. </p> </note> 

</slide>

<slide>
<title>text()</title>


<p>The <code>text()</code> node test specifically refers to the parsed character 
data content of an element. It's most commonly used with mixed content. For 
instance <code>/descendant::text()</code> will refer to all of the text but none 
of the markup of a document. </p>

<note>XPointers that point to text nodes are tricky. I recommend you avoid them 
if possible, just as you should avoid mixed content. Of course, you may not 
always be able to, especially if you need to point to parts of documents written 
by other authors who don't follow this best practice.</note>


<p>Because character data does not contain child elements, further relative 
location terms may not be attached to an XPointer that selects a text node. </p>

</slide>

<slide>
<title>comment()</title>



<p>The <code>comment()</code> node test specifically refers to comments. 

For example, this XPointer points to the third comment in the document:</p>

<pre><code>/descendant::comment()[position()=3]
</code></pre>

<p>Because comments do not contain attributes or elements, you cannot add an 
additional <code>child</code>, <code>descendant</code>, or 
<code>attribute</code> relative location step after the first term that selects 
a comment.You can use a <code>string</code> relative location axis 
to select part of the text of the comment, though.</p>

</slide>

<slide>
<title>processing-instruction()</title>

<ul>
<li>The <code>processing-instruction()</code> node test selects any 
processing instructions that occur along the chosen axis.</li>
<li>Use it without 
any arguments to select any processing instructions</li>
<li>Use it with arguments to 
specify the particular processing instruction targets you want to select.</li>
</ul>


<p> <code>/descendant::processing-instruction()</code></p>
<p><code>/descendant::processing-instruction(xml-stylesheet)</code></p>
<p><code>/descendant::processing-instruction(php)</code></p>

<note><p>
 <code>/descendant::processing-instruction()</code> selects all 
processing instructions in the document. However, <code>/descendant::processing-
instruction(xml-stylesheet)</code> only finds processing instructions that begin 
<code>&lt;?xml-stylesheet</code>. <code>/descendant::processing-instruction(php)</code> only finds processing instructions intended for PHP.  As 
with comments, because processing instructions do not contain attributes or 
elements, you cannot add an additional <code>child</code>, 
<code>descendant</code>, or <code>attribute</code> relative location term after 
the first term that selects a processing instruction.  However, you can use a 
<code>string</code> location step to select part of the text of the processing 
instruction.</p>
</note>

</slide>

<slide>
<title>Predicates</title>

<p>Each location step can contain zero or more predicates that further restrict 
which nodes an XPointer points to. In most non-trivial cases a predicate is 
necessary to pick the one node from a node set that you want. 
Each predicate contains an 
expression in square brackets (<code>[]</code>) that further winnows the node 
set. This allows an XPointer to select nodes according to many different 
criteria. For example, you can select:</p> <ul>

<li>All elements that have a specified attribute</li>
<li>All elements that have a specified attribute with a specified value</li>
<li>The first element that contains a specified child element</li>
<li>An element whose text content includes a specified string</li>
<li>All elements that are not the first or last children of their parents</li>
<li>All elements whose value is a number</li>
<li>All elements whose value is a number greater than 100</li>
</ul>

<p>These are just a small sampling of the selections that predicates make possible. </p>


</slide>

<slide>
<title>XPointer Predicates are booleans</title>


<note>XPointer predicate expressions do have one small distinction from the expressions used in XSL. The result of an XPointer predicate expression is ultimately converted to a boolean after all calculations are finished.</note>

<p>Non-boolean results are converted as follows:</p>
<ul>
<li>A number is false if it's zero or NaN (a special symbol meaning "Not a Number", used for the result of dividing by zero and similar illegal operations), true otherwise.</li>
<li>An empty node set is false; all other node sets are true.</li>
<li>An empty result fragment is false; all other result fragments are true.</li>
<li>A zero length string is false; all other strings are true (including the string "false")</li>
</ul>

<p>The predicate expression is evaluated for each node in the context node list. Each node for which the expression ultimately evaluates to false is removed from the list. Thus only those nodes that satisfy the predicate remain. </p>

</slide>

<slide>
<title>position()</title>

<p>Probably the function most frequently used in XPointer predicates is <code>position()</code>. This returns the index of the node in the context node list. This allows you to find the first, second, third, or other indexed node. You can compare positions using the various relational operators like <code>&lt;</code>, <code>&gt;</code>, <code>=</code>, <code>!=</code>, <code>&gt;=</code>, and <code>&lt;=</code>.</p>

<p>For instance, in the family tree document, the root element is 
<code>FAMILYTREE</code> element is the root. It has 14 immediate children, 12 
<code>PERSON</code> elements, and two <code>FAMILY</code> elements. In order, 
they are:</p>

<pre><code>/child::FAMILYTREE/child::*[position()=1]
/child::FAMILYTREE/child::*[position()=2]
/child::FAMILYTREE/child::*[position()=3]
/child::FAMILYTREE/child::*[position()=4]
/child::FAMILYTREE/child::*[position()=5]
/child::FAMILYTREE/child::*[position()=6]
/child::FAMILYTREE/child::*[position()=7]
/child::FAMILYTREE/child::*[position()=8]
/child::FAMILYTREE/child::*[position()=9]
/child::FAMILYTREE/child::*[position()=10]
/child::FAMILYTREE/child::*[position()=11]
/child::FAMILYTREE/child::*[position()=12]
/child::FAMILYTREE/child::*[position()=13]
/child::FAMILYTREE/child::*[position()=14]
</code></pre>

<note>
<p>Greater numbers, such as <code>/child::FAMILYTREE/child::*[position()=15]</code>, 
don't point at anything. They're just dangling. To count all elements in the document, 
not just the immediate children of the root, you can use <code>descendant</code> instead 
of <code>child</code>. </p>
</note>

</slide>

<slide>
<title>String Location Terms</title>


<note>
<p>Selecting a particular element is almost always good enough for pointing into 
well-formed XML documents. However, on occasion you need to point into XML data 
in which large chunks of non-XML text is embedded via <code>CDATA</code> 
sections, comments, processing instructions, or some other means. In these cases 
you may need to refer to particular ranges of text in the document that don't 
map onto any particular markup element. Or you may need to point into non-XML 
substructure in the text content of particular elements; for example the month 
in a <code>BORN</code> element that looks like this:</p>
</note>

<p>Suppose you may need to point into non-XML 
substructure in the text content of particular elements; for example the month 
in a <code>BORN</code> element that looks like this:</p>

<pre><code>&lt;BORN&gt;11 Feb 1858&lt;/BORN&gt;
</code></pre>

<ul>
<li>The <code>string</code> axis selects one or more occurrences of a specified string</li>
<li>One of the least stable parts of XPointer; may be added to XPath in the future</li>


<note>
<p>You can use the <code>string</code> axis to do this. At the time of this 
writing (July, 1999), the <code>string</code> axis is only a part of XPointer, 
not of XPath, so you can't use it with select expressions in XSL. However 
something like it may well be added to XPath in the future, in which case this 
material will likely become at least partially obsolete. </p>


<p>A string location term points to an occurrence of a specified string, or a 
substring of a given string in the text (not markup) of the document. For 
example, this XPointer finds all occurrences of the string "Harold":</p>
</note>

<li> This selects all occurrences of the string "Harold":</li>

<pre><code>xptr(/string::"Harold")
</code></pre>

<note>
<p>
String location terms may have node tests. Thus this XPointer finds only the first occurrence of the string "Harold":
</p>
</note>
<li>
String location terms may have node tests: 

<p><code>xptr(/string::"Harold"[position()=1])
</code></p>
</li>
</ul>

</slide>

<slide>
<title>Position and Length in String Location Terms</title>

<note>
<p>This targets the position immediately preceding the <i>H</i> in Harold in Charles Walter Harold's <code>NAME</code> element. This is not the same as pointing at the entire <code>NAME</code> element as an element-based selector would do.</p>
</note>
<ul>
<li>A second numeric argument targets a particular position in the string. For example,  this targets whatever immediately follows the first occurrence of the string &quot;Harold&quot; because <i>Harold</i> has six letters:

<pre><code>xptr(/string::"Harold",6[position()=1])
</code></pre>
</li>

<li>An optional third number specifies the number of characters to select. For example, this URI selects the first occurrence of the entire string &quot;Harold&quot;:

<p><code>xptr(/string::"Harold",1,6[position()=1])
</code></p>
</li>

<li>If the first string argument in the node test is the empty string, then 
relevant positions in the context node's text contents will be selected. For 
example, this XPointer targets the first six characters of the 
document:

<p><code>xptr(/string::"",1,6[position()=1])
</code></p>
</li>

<li>When matching strings, case is considered. White space is condensed to a 
single space. Markup characters are ignored.</li>

<li>The most common use of the string axis is to select part of the text 
contents of a node previously selected by more conventional means, rather than 
to pick an absolute location in the document. For example, this selects the 
month in the first <code>BORN</code> element:

<p><code>/descendant::BORN[position()=1]/string::" ",2,3[position() = 1]
</code></p>

</li>
</ul>

</slide>

<slide>
<title>Ranges</title>

<p>In some applications it may be important to specify a range of a document rather than a particular point in a document. This can be accomplished with the <code>range</code> axis. A range begins at one XPointer and continues until another XPointer. A range is indicated by the keyword <code>range</code> used as a location term. However, it is followed by two location terms separated by a comma. The first identifies the start of the range and the second identifies the end of the range. </p>

<p>For example, suppose you want to select everything between the first <code>PERSON</code> element and the last <code>PERSON</code> element in genealogy.xml. This XPointer accomplishes that:</p>

<p><code>range::/child::PERSON[position() = 1],/child::PERSON[position() = last()]
</code></p>
</slide>

<slide> <title>Tumblers</title>

<p> One common way to identify an 
element in an XML document is by location. Identifying an 
element by location is generally accomplished by counting children down from the 
root. For example, the following XPointer points to John P. Muller's 
<code>PERSON</code> element: </p> 

<p><code>/child::*[position()=1]/child::*[position()=4] </code></p>

<p>
A <dfn>tumbler</dfn> is a shortcut for XPointers exemplified by the second example above; that is, an XPointer that consists of nothing but a series of child relative location steps counting down from the root node, each of which selects a particular child by position only. The shortcut is to use only the position number and the slashes that separate individual elements from each other, like this:
</p>
<p><code>http://www.harolds.net/genealogy.xml#/1/4
</code></p>

<p>
<code>/1/4</code> is a tumbler that says to select the fourth child element of the first child element of the root. This syntax can be extended for any depth of child elements. For example these two URIs point to John P. Muller's <code>NAME</code> and <code>SPOUSE</code> elements respectively:
</p>
<pre><code>http://www.harolds.net/genealogy.xml#/1/4/1
http://www.harolds.net/genealogy.xml#/1/4/2
</code></pre>

<p>
Each tumbler always points to a single element. You cannot use tumblers with any other relative location steps. You cannot use them to select elements of a particular type. You cannot use them to select attribute or strings. You can only use them to select a single element by its relative location in the tree. 
</p>
</slide>

<slide>
<title>XPointer Summary</title>

<ul>
<li>XPointers refer to particular parts of or locations in XML documents.</li>
<li>An XPointer is composed of location steps.</li>
<li>The <code>id</code> absolute location step points to an element with a specified value for an <code>ID</code> type attribute.</li>
<li>The <code>root</code> absolute location step points to the root element of an XML document and is generally abbreviated as simply <code>/</code>.</li>
<li>Location steps can be chained to make more sophisticated compound locators.</li>
<li>Relative location steps select nodes in a document based on their relationship to a context node, generally provided by either an absolute location step or another relative location step.</li>
<li>Each relative location step contains an axis, a node test, and zero or more predicates.</li>
<li>The <code>self</code> axis points to the context node.</li>
<li>The <code>parent</code> axis points to the node that contains the context node.</li>
<li>The <code>child</code> axis points to immediate children of the context node.</li>
<li>The <code>descendant</code> axis points to all elements contained in the context node.</li>
<li>The <code>descendant-or-self</code> axis points to all elements contained in the context node as well as the context node itself.</li>
<li>The <code>ancestor</code> axis points to an element that contains the context node.</li>
<li>The <code>ancestor-or-self</code> axis points to all elements that contain the context node as well as the context node itself.</li>
<li>The <code>preceding</code> axis points to any element that comes before the context node.</li>
<li>The <code>following</code> axis points to any element following the context node.</li>
<li>The <code>preceding-sibling</code> axis selects from sibling elements that precede the context node.</li>
<li>The <code>following-sibling</code> axis selects from sibling elements that follow the context node.</li>
<li>The <code>attribute</code> axis points to an attribute of the context node.</li>
<li>The node test of a relative location step is normally an element name, but may also be the <code>*</code> wild card to select all elements or one of the keywords <code>comment()</code>, <code>text()</code>, <code>processing-instruction()</code>, or <code>node()</code>.</li>
<li>The optional predicate of a relative location step is an XPath expression enclosed in square brackets that further narrows down the node set the XPointer refers to.</li>
<li>The <code>string</code> location term points to a specified block of text in the location source.</li>
<li>The <code>range</code> axis selects the XML fragment between two XPointers.</li>
<li>A tumbler points to an element by counting children from the root. </li>
</ul>
</slide>

<slide>

<title>To Learn More</title>


<IMG SRC="mediumbiblecover.jpg" width="220" height="271" align="left"/>
  <ul>
  <li>The XML Bible</li>
  <li>Elliotte Rusty Harold</li>
  <li>IDG Books, 1999</li>
  <li>ISBN: 0-7645-3236-7 </li>
  </ul>
  <br clear="all"/>
  
  <ul>
  <li>This presentation: <a href="http://metalab.unc.edu/xml/slides/xmlsig0899">http://metalab.unc.edu/xml/slides/xmlsig0899/</a></li>
  <li>XPointers: <a href="http://metalab.unc.edu/xml/books/bible/updates/17.html">http://metalab.unc.edu/xml/books/bible/updates/17.html</a></li>
  <li>XLinks: 
  <a href="http://metalab.unc.edu/xml/books/bible/updates/16.html">http://metalab.unc.edu/xml/books/bible/updates/16.html</a></li>
  <li>XPath Specification: <a href="http://www.w3.org/TR/xpath">http://www.w3.org/TR/xpath</a></li>
  <li>XPointer Specification: <a href="http://www.w3.org/TR/WD-xptr">http://www.w3.org/TR/WD-xptr</a></li>
  <li>XLink Specification: <a href="http://www.w3.org/TR/xlink">http://www.w3.org/TR/xlink</a></li>

  </ul>

</slide>

</presentation>
