<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE spec PUBLIC "-//W3C//DTD Specification::19971229//EN" "xmlspec.dtd" [
<!--ArborText, Inc., 1988-1997, v.4001-->
<!ENTITY iso6.doc.date "19980303">
<!ENTITY doc-type "WD-xlink">
]>
<?Pub UDT _bookmark _target?>
<?Pub Inc?>
<spec>
<!-- Last edited: 3 March 1998 by elm-->
<header>
<title>XML Linking Language (XLink)</title>
<version>Version 1.0</version>
<w3c-designation>&doc-type;-&iso6.doc.date;</w3c-designation>
<w3c-doctype>World Wide Web Consortium Working Draft</w3c-doctype>
<pubdate><day>3</day><month>March</month><year>1998</year></pubdate>
<notice>
<p>This draft is for public discussion.</p>
</notice>
<publoc><loc href="http://www.w3.org/TR/WD-xll-&iso6.doc.date;">http://www.w3.org/TR/&doc-type;-&iso6.doc.date;</loc>
</publoc>
<prevlocs><loc href="http://www.w3.org/TR/WD-xml-link-970731">http://www.w3.org/TR/WD-xml-link-970731
</loc></prevlocs>
<latestloc><loc href="http://www.w3.org/TR/&doc-type;">http://www.w3.org/TR/&doc-type;<?Pub Caret?></loc>
</latestloc>
<authlist>
<author><name>Eve Maler</name><affiliation>ArborText</affiliation><email href="mailto:elm@arbortext.com">
elm@arbortext.com</email></author>
<author><name>Steve DeRose</name><affiliation>Inso Corp. and Brown University
</affiliation><email href="sderose@eps.inso.com">sderose@eps.inso.com</email>
</author>
<!-- how shall we cite Tim? sjd What about with an Acknowledgments section?
-elm <AUTHOR> <NAME>Tim Bray</NAME> <AFFILIATION>Textuality</AFFILIATION>
<EMAIL>tbray@textuality.com</EMAIL> </AUTHOR>-->
</authlist>
<status>
<statusp>This is a W3C Working Draft for review by W3C members and other interested
parties. It is a draft document and may be updated, replaced, or obsoleted
by other documents at any time. It is inappropriate to use W3C Working Drafts
as reference material or to cite them as other than "work in progress". A
list of current W3C working drafts can be found at <loc href="http://www.w3.org/TR">
http://www.w3.org/TR</loc>.</statusp>
<statusp>This work is part of the W3C XML Activity (for current status, see <loc
href="http://www.w3.org/MarkUp/SGML/Activity">http://www.w3.org/MarkUp/XML/Activity
</loc>). For information about the XPointer language which is expected to
be used with XLink, see <loc href="http://www.w3.org/MarkUp/SGML/Activity">
http://www.w3.org/TR/WD-xptr</loc>.</statusp>
<statusp>See <loc href="http://www.w3.org/TR/NOTE-xlink-principles">http://www.w3.org/TR/NOTE-xlink-principles
</loc> for additional background on the design principles informing XLink.
</statusp>
</status>
<abstract>
<p>This document specifies constructs that may be inserted into XML resources
to describe links between objects. It uses XML syntax to create structures
that can describe the simple unidirectional hyperlinks of today's HTML as
well as more sophisticated multi-ended and typed links.</p>
</abstract>
<pubstmt>
<p>Burlington, Seekonk, et al.: World-Wide Web Consortium, XML Working Group,
1998.</p>
</pubstmt>
<sourcedesc>
<p>Created in electronic form.</p>
</sourcedesc>
<langusage>
<language id="en">English</language>
<language id="ebnf">Extended Backus-Naur Form (formal grammar)</language>
</langusage>
<revisiondesc>
<slist>
<sitem>1997-01-15 : Skeleton draft by TB</sitem>
<sitem>1997-01-24 : Fleshed out by sjd</sitem>
<sitem>1997-04-08 : Substantive draft</sitem>
<sitem>1997-06-30 : Public draft</sitem>
<sitem>1997-08-01 : Public draft</sitem>
<sitem>1997-08-05 : Prose/organization work by sjd</sitem>
<sitem>1997-10-14: Conformance and design principles; a bit of cleanup by
elm</sitem>
<sitem>1997-11-07: Update for editorial issues per issues doc, by sjd.</sitem>
<sitem>1997-12-01: Update for editorial issues per issues doc in preparation
for F2F meeting, by sjd.</sitem>
<sitem>1998-01-13: Editorial cleanup, addition of new design principles, by
elm.</sitem>
<sitem>1998-02-27: Splitting out of XLink and XPointer, by elm.</sitem>
<sitem>1998-03-03: Moved most of the XPointer locator stuff here. elm</sitem>
</slist>
</revisiondesc></header>
<body>
<div1>
<head>Introduction</head>
<p>This document specifies constructs that may be inserted into XML resources
to describe links between objects. A <termref def="dt-link">link</termref>,
as the term is used here, is an explicit relationship between two or more
data objects or portions of data objects. This specification is concerned
with the syntax used to assert link existence and describe link characteristics.
Implicit (unasserted) relationships, for example that of one word to the next
or that of a word in a text to its entry in an on-line dictionary are obviously
important, but outside its scope.</p>
<p>Links are asserted by <xtermref href="WD-xml-lang.html#dt-element">elements
</xtermref> contained in <xtermref href="WD-xml-lang.html#dt-xml-doc">XML
documents</xtermref>. The simplest case is very like an HTML <code>A</code>
link, and has these characteristics: <ulist>
<item><p>The link is expressed at one of its ends (similar to the <code>A
</code> element in some document)</p></item>
<item><p>Users can only initiate travel from that end to the other</p></item>
<item><p>The link's effect on windows, frames, go-back lists, stylesheets
in use, and so on is mainly determined by browsers, not by the link itself.
For example, traversal of <code>A</code> links normally replaces the current
view, perhaps with a user option to open a new window.</p></item>
<item><p>The link goes to only one destination (although a server may have
great freedom in finding or dynamically creating that destination).</p></item>
</ulist></p>
<p>While this set of characteristics is already very powerful and obviously
has proven itself highly useful and effective, each of these assumptions also
limits the range of hypertext functionality. The linking model defined here
provides ways to create links that go beyond each of these specific characteristics,
thus providing features previously available mostly in dedicated hypermedia
systems.</p>
<div2>
<head>Origin and Goals</head>
<p>Following is a summary of the design principles governing XLink:<olist>
<item><p>XLink shall be straightforwardly usable over the Internet.</p></item>
<item><p>XLink shall be usable by a wide variety of link usage domains and
of classes of linking application software.</p></item>
<item><p>The XLink expression language shall be XML.</p></item>
<item><p>The XLink design shall be prepared quickly.</p></item>
<item><p>The XLink design shall be formal and concise.</p></item>
<item><p>XLinks shall be human-readable.</p></item>
<item><p>XLinks may reside outside the documents in which the participating
resources reside.</p></item>
<item><p>XLink shall represent the abstract structure and significance of
links.</p></item>
<item><p>XLink must be feasible to implement.</p></item>
</olist></p>
</div2>
<div2>
<head>Relationship to Existing Standards</head>
<p>Three standards have been especially influential: <ulist>
<item><p><emph>HTML:</emph> Defines several SGML element types that represent
links.</p></item>
<item><p><emph>HyTime:</emph> Defines inline and out-of-line link structures
and some semantic features, including traversal control and presentation of
objects.   
<!--Changed from "placement
of objects into a display or other space" -elm-->
</p></item>
<item><p><emph>Text Encoding Initiative Guidelines (TEI P3):</emph> Provide
structures for creating links, aggregate objects, and link collections.</p>
</item>
</ulist></p>
<p>Many other linking systems have also informed this design, especially Dexter,
FRESS, MicroCosm, and InterMedia.</p>
</div2>
<div2>
<head>Terminology</head>
<p>The following basic terms apply in this document.   
<!--<IMG SRC="local://./linkdiag.gif">(figure
to be inserted)-->
<glist>
<gitem><label><termdef id="dt-eltree" term="Element Tree">element tree</termdef></label>
<def>
<p>A representation of the relevant structure specified by the tags and attributes
in an XML document, based on "groves" as defined in the ISO DSSSL standard.
</p>
</def></gitem>
<gitem><label><termdef id="dt-inline" term="In-Line Link">inline link</termdef></label>
<def>
<p>Abstractly, a <termref def="dt-link">link</termref> which serves as one
of its own <termref def="dt-resource">resources</termref>. Concretely, a link
where the content of the <termref def="dt-linkel">linking element</termref>
serves as a <termref def="dt-particip-resource">participating resource</termref>.
HTML <code>A</code>, HyTime <code>clink</code>, and TEI <code>XREF</code>
are all examples of inline links.</p>
</def></gitem>
<gitem><label><termdef id="dt-link" term="Link">link</termdef></label>
<def>
<p>An explicit relationship between two or more data objects or portions of
data objects.</p>
</def></gitem>
<gitem><label><termdef id="dt-linkel" term="Linking Element">linking element
</termdef></label>
<def>
<p>An <xtermref href="WD-xml-lang.html#dt-element">element</xtermref> that
asserts the existence and describes the characteristics of a <termref def="dt-link">
link</termref>.</p>
</def></gitem>
<gitem><label><termdef id="dt-local-resource" term="Local Resource">local
resource</termdef></label>
<def>
<p>The content of an <termref def="dt-inline">inline</termref> linking element.
Note that the content of the linking element could be explicitly pointed to
by means of a regular <termref def="dt-locator">locator</termref> in the same
linking element, in which case the resource is considered <termref def="dt-remote-resource">
remote</termref>, not local.</p>
</def></gitem>
<gitem><label><termdef id="dt-locator" term="Locator">locator</termdef></label>
<def>
<p>Data, provided as part of a link, which identifies a <termref def="dt-resource">
resource</termref>.</p>
</def></gitem>
<gitem><label><termdef id="dt-multidir" term="Multi-Directional Link">multidirectional
link</termdef></label>
<def>
<p>A <termref def="dt-link">link</termref> whose <termref def="dt-traversal">
traversal</termref> can be initiated from more than one of its <termref def="dt-particip-resource">
participating resources</termref>. Note that being able to "go back" after
following a one-directional link does not make the link multidirectional.
</p>
</def></gitem>
<gitem><label><termdef id="dt-outofline" term="Out-of-line Link">out-of-line
link</termdef></label>
<def>
<p>A <termref def="dt-link">link</termref> whose content does not serve as
one of the link's <termref def="dt-particip-resource">participating resources
</termref>. Such links presuppose a notion like <termref def="dt-xlg">extended
link groups</termref>, which indicate to application software where to look
for links. Out-of-line links are generally required for supporting multidirectional <termref
def="dt-traversal">traversal</termref> and for allowing read-only resources
to have outgoing links.</p>
</def></gitem>
<gitem><label><termdef id="dt-particip-resource" term="Participating Resource">
participating resource</termdef></label>
<def>
<p>A <termref def="dt-resource">resource</termref> that belongs to a link.
All resources are potential contributors to a link; participating resources
are the actual contributors to a particular link.</p>
</def></gitem>
<gitem><label><termdef id="dt-remote-resource" term="Remote Resource">remote
resource</termdef></label>
<def>
<p>Any participating resource of a link that is pointed to with a locator.
</p>
</def></gitem>
<gitem><label><termdef id="dt-resource" term="Resource">resource</termdef></label>
<def>
<p>In the abstract sense, an addressable service or unit of information that
participates in a <termref def="dt-link">link</termref>. Examples include
files, images, documents, programs, and query results. Concretely, anything
reachable by the use of a <termref def="dt-locator">locator</termref> in some <termref
def="dt-linkel">linking element</termref>. Note that this term and its definition
are taken from the basic specifications governing the World Wide Web.   
<!--Joel notes: need link here.-->
</p>
</def></gitem>
<gitem><label><termdef id="dt-subresource" term="sub-Resource">sub-resource
</termdef></label>
<def>
<p>A portion of a resource, pointed to as the precise destination of a link.
As one example, a link might specify that an entire document be retrieved
and displayed, but that some specific part(s) of it is the specific linked
data, to be treated in an application-appropriate manner such as indication
by highlighting, scrolling, etc.</p>
</def></gitem>
<gitem><label><termdef id="dt-traversal" term="Traversal">traversal</termdef></label>
<def>
<p>The action of using a <termref def="dt-link">link</termref>; that is, of
accessing a <termref def="dt-resource">resource</termref>. Traversal may be
initiated by a user action (for example, clicking on the displayed content
of a <termref def="dt-linkel">linking element</termref>) or occur under program
control.</p>
</def></gitem>
</glist></p>
</div2>
<div2>
<head>Notation</head>
<p>The formal grammar for <termref def="dt-locator">locators</termref> is
given using a simple Extended Backus-Naur Form (EBNF) location, as described
in <xspecref href="http://www.w3.org/TR/WD-xml-lang.html#sec-notation">the
XML specification</xspecref>.</p>
</div2>
</div1>
<div1 id="addressing">
<head>Locator Syntax</head>
<p>The locator for a <termref def="dt-resource">resource</termref> is typically
provided by means of a Uniform Resource Identifier, or URI. XPointers can
be used in conjunction with the URI structure, as fragment identifiers or
queries, to specify a more precise sub-resource. XPointers can be used in
conjunction with URIs to specify a more precise sub-resource.</p>
<p>A locator generally contains a URI,   
<!--Is there some restriction on URNs having
queries and/or fragment identifiers?  Since these RFCs
don't mention URIs explicitly, should the wording
here lead from URLs to URIs more explicitly? -elm-->
as described in IETF RFCs <bibref ref="rfc1738"/> and <bibref ref="rfc1808"/>.
As these RFCs state, the URI may include a trailing <emph>query</emph> (marked
by a leading "<code>?</code>"), and be followed by a "<code>#</code>" and
a <emph>fragment identifier</emph>, with the query interpreted by the host
providing the indicated resource, and the interpretation of the fragment identifier
dependent on the data type of the indicated resource.</p>
<p>In order to locate XML documents and portions of documents, a locator value
may contain either a <xtermref href="http://www.w3.org/Addressing/rfc1738.txt">
URI</xtermref> or a fragment identifier, or both. Any fragment identifier
for pointing into XML must be an <xtermref href="http://www.w3.org/TR/WD-xptr#dt-xpointer">
XPointer</xtermref>.</p>
<p>Special syntax may be used to request the use of particular processing
models in accessing the locator's resource. This is designed to reflect the
realities of network operation, where it may or may not be desirable to exercise
fine control over the distribution of work between local and remote processors. <scrap
id="locator" lang="ebnf">
<head>Locator</head>
<prod id="nt-locator">
<lhs>Locator</lhs><rhs><nt def="nt-uri">URI</nt></rhs>
<rhs>| <nt def="nt-connector">Connector</nt> (<xnt href="http://www.w3.org/TR/WD-xptr">
XPointer</xnt> | <xnt href="WD-xml-lang.html#NT-Name">Name</xnt>)</rhs>
<rhs>| <nt def="nt-uri">URI</nt> <nt def="nt-connector">Connector</nt> (<xnt
href="http://www.w3.org/TR/WD-xptr">XPointer</xnt> | <xnt href="WD-xml-lang.html#NT-Name">
Name</xnt>)</rhs>
</prod>
<prod id="nt-connector">
<lhs>Connector</lhs><rhs>'#' | '|'</rhs>
</prod>
<prod id="nt-uri">
<lhs>URI</lhs><rhs><xnt href="WD-xml-lang.html#NT-URLchar">URIchar*</xnt></rhs>
</prod>
</scrap> </p>
<p><termdef id="dt-designated" term="Designated Resource">In this discussion,
the term <term>designated resource</term> refers to the resource which an
entire locator serves to locate.</termdef> The following rules apply:<ulist>
<item><p><termdef id="dt-containing-resource" term="Containing Resource">
The URI, if provided, locates a resource called the <term>containing resource
</term>.</termdef></p></item>
<item><p>If the URI is not provided, the containing resource is considered
to be the document in which the linking element is contained.   
<!--Is this now incorrect, given the nature of the switch from here() to origin()? -elm
Oy, yes, i think so. it will require some fun wording, though, so i haven't fixed it yet here -sjd-->
</p></item>
<item><p><termdef id="dt-sub-resource" term="Sub-Resource">If an XPointer
is provided, the designated resource is a <term>sub-resource</term> of the
containing resource; otherwise the designated resource is the containing resource.
</termdef></p></item>
<item><p>If the <nt def="nt-connector">Connector</nt> is followed directly
by a <xnt href="WD-xml-lang.html#NT-Name">Name</xnt>, the <xnt href="WD-xml-lang.html#NT-Name">
Name</xnt> is shorthand for the XPointer "<code>id(Name)</code>"; that is,
the sub-resource is the element in the containing resource that has an XML <xtermref
href="WD-xml-lang.html#sec-attrtypes">ID attribute</xtermref> whose value <xtermref
href="WD-xml-lang.html#dt-match">matches</xtermref> the <xnt href="WD-xml-lang.html#NT-Name">
Name</xnt>. This shorthand is to encourage use of the robust <code>id</code>
addressing mode.</p></item>
<item><p>If the connector is "<code>#</code>", this signals an intent that
the containing resource is to be fetched as a whole from the host that provides
it, and that the XPointer processing to extract the sub-resource is to be
performed on the client, that is to say on the same system where the linking
element is recognized and processed.</p></item>
<item><p>If the connector is "<code>|</code>", no intent is signaled as to
what processing model is to be used for accessing the designated resource.
</p></item>
</ulist></p>
<p>Note that by definition, a URI includes an optional query component.</p>
<p>In the case where the URI contains a query (to be interpreted by the server),
information providers and authors of server software are urged to use queries
as follows:<scrap id="querysyntax" lang="ebnf">
<head>Query</head>
<prod id="nt-query">
<lhs>Query</lhs><rhs>'XML-XPTR=' (<xnt href="http://www.w3.org/TR/WD-xptr">
XPointer</xnt> | <xnt href="WD-xml-lang.html#NT-Name">Name</xnt>)</rhs>
</prod>
</scrap></p>
</div1>
<div1>
<head>Link Recognition</head>
<p>The existence of a <termref def="dt-link">link</termref> is asserted by
a <termref def="dt-linkel">linking element</termref>. Linking elements must
be recognized reliably by application software in order to provide appropriate
display and behavior. There are several ways link recognition could be accomplished:
for example, reserving element type names, reserving attributes, or leaving
the matter of recognition entirely up to stylesheets and application software.
Reserving attributes provides a balance between giving users control of their
own markup language design and keeping the important structural fact "is a
link" explicit within documents. Therefore, XLink linking-related elements
are recognized based on the use of a designated <xtermref href="WD-xml-lang.html#dt-attr">
attribute</xtermref> named <code>xml:link</code>. Possible values are <code>
simple</code> and <code>extended</code> (which identify linking elements),
as well as <code>locator</code>, <code>group</code>, and <code>document</code>
(which identify other related types of elements). An element in whose start-tag
such an attribute appears is to be treated as an element of the indicated
XLink type as dictated by this specification. For example:<eg>&lt;A xml:link="simple" href="http://www.w3.org/">The W3C&lt;/A>
</eg></p>
<p>Note: Subject to definitions to be developed in related standards, the
methods described in <specref ref="remapping"/> may be used to rename the
reserved attribute.</p>
<p>There are two mechanisms that may be used to associate the <code>xml:link
</code> and <code>xml:attributes</code> attributes with a linking element.
The simplest is to provide the attribute explicitly in a start-tag. A less
verbose method is to use XML's facilities for declaring <xtermref href="WD-xml-lang#dt-default">
default attribute values</xtermref>. For example, the following attribute-list
declaration would indicate that all instances of the <code>A</code> element
in the current document are XLink simple links:<eg>&lt;!ATTLIST A xml:link CDATA #FIXED "simple">
</eg></p>
</div1>
<div1>
<head>Linking Elements</head>
<p>XLink defines two types of <termref def="dt-linkel">linking element</termref>:<ulist>
<item><p>A simple link, which is usually <termref def="dt-inline">inline</termref>
and always one-directional</p></item>
<item><p>A much more general extended link, which may be either inline or <termref
def="dt-outofline">out-of-line</termref> and must be used for <termref def="dt-multidir">
multidirectional</termref> links, links originating from read-only resources,
and so on.</p></item>
</ulist></p>
<p>Both kinds of links can have various types of information associated with
them.</p>
<div2 id="link-atts">
<head>Information Associated with Links</head>
<p>The following information can be associated with a link and its resources:<ulist>
<item><p>One or more locators to identify the remote resources participating
in the link; a locator is required for each remote resource</p></item>
<item><p>Semantics of the link</p></item>
<item><p>Semantics of the <termref def="dt-remote-resource">remote resources
</termref></p></item>
<item><p>Semantics of the <termref def="dt-local-resource">local resource
</termref>, if the link is inline</p></item>
</ulist></p>
<p>This information is supplied in the form of attributes   
<!--insert xspecref
to XML spec around this phrase-->
 on linking elements. In the following sections, parameter entities   
<!--link to definition of PE-->
are used to group these attributes.</p>
<!--Need info about architectural forms/templates
here, e.g. that the sample declarations show the *maximums*
for element and attribute constraints. -elm-->
<div3>
<head>Locators</head>
<p>A locator string identifies a participating resource. A link must supply
a locator for each remote resource.</p>
<p>A locator takes the form of an attribute called <code>href</code>. Following
is a sample declaration of this attribute, enclosed in a <code>locator.att
</code> parameter entity.<eg>&lt;!ENTITY % locator.att
  "href          CDATA               #REQUIRED"
></eg></p>
</div3>
<div3 id="link-semantics-atts">
<head>Link Semantics</head>
<p>The following semantic information can be provided for a link:<ulist>
<item><p>Whether the link is <termref def="dt-inline">inline</termref></p>
<p>If the link is inline, its content counts as a <termref def="dt-local-resource">
local resource</termref> of the link. (However, any locator subelements inside
the linking element are <emph>not</emph> considered part of the local resource;
they are simply part of the linking element machinery.) If the link is out-of-line,
its content does not count as a local resource. Every link is either inline
or out-of-line.</p>
<p>The inline status of a link is indicated with an attribute called <code>
inline</code>. It can have the value <code>true</code> (the default) or <code>
false</code>.</p></item>
<item><p><termdef id="dt-role" term="Role">The <term>role</term> of the link,
to identify to application software the meaning of the link</termdef></p>
<p>Links express various kinds of conceptual relationships between the data
objects or portions they connect, in terms of significance to the author and
user. Some links may be criticisms, others add support or background, while
still others might provide access to demographic information about a data
object (its author's name, version number, etc), or to navigational tools
such as index, glossary, and summary.   
<!--(OK to remove the following sentence?
-elm) As with markup in general, the user perceives
these relationships indirectly, because of their
formatting or behavioral effects; yet their significance
goes beyond that, and authors often must be concerned
with them directly.-->
</p>
<p>To indicate the part that a link plays in representing information, a link
author can optionally provide a string identifying the link's role. The role
is indicated with an attribute called <code>role</code>.</p>
<p>(Note that each resource participating in a link may also be given its
own role, as described in <specref ref="remote-semantics-atts"/>.)</p>
<!--a set of pre-defined link roles is
included in this specification. A sub-role may be
created by appending "." and the sub-role name. This
process may be repeated in order to create role
hierarchies. Tb? -->
</item>
</ulist></p>
<p>Following are sample declarations of these attributes, enclosed in a <code>
link-semantics.att</code> parameter entity.<eg>&lt;!ENTITY % link-semantics.att
  "inline        (true|false)        'true'
   role          CDATA               #IMPLIED"
></eg></p>
<p>Because simple links have an attribute called <code>role</code> that has
a different function, they cannot have a <code>role</code> attribute for link
semantics. Following is a <code>simple-link-semantics.att</code> parameter
entity declaration for use in simple linking elements.<eg>&lt;!ENTITY % simple-link-semantics.att
  "inline        (true|false)        'true'"
></eg></p>
</div3>
<div3 id="remote-semantics-atts">
<head>Remote Resource Semantics</head>
<p>The following semantic information can be provided for the remote resources
of a link:<ulist>
<item><p>The role of the resource, to identify to application software the
part it plays in the link</p>
<p>(Note that a link as a whole may also be given its own role, as described
in <specref ref="link-semantics-atts"/>.)</p>
<p>A link author can optionally provide role information in an attribute called <code>
role</code>.</p></item>
<item><p>A title for the resource, to serve as a displayable caption that
explains to users the part the resource plays in the link</p>
<p>A link author can optionally provide title information in an attribute
called <code>title</code>. XLink does not require that application software
make any particular use of title information.</p></item>
<item><p>Behavior policies to use in traversing to this resource</p>
<p>A link author can optionally use attributes called <code>show</code> and <code>
actuate</code> to communicate general policies concerning the traversal behavior
of the link. The <code>show</code> attribute can have one of the values <code>
new</code>, <code>replace</code>, and <code>embed</code>; the <code>actuate
</code> attribute can have one of the values <code>auto</code> and <code>
user</code>.</p>
<p>A link author can also optionally use an attribute called <code>behavior
</code> to communicate detailed instructions for traversal behavior. The contents,
format, and meaning of this attribute are unconstrained.</p>
<p>(See <specref ref="behavior"/> for more information on the behavior-related
attributes.)</p>
<!--(Removed this note because it *doesn't*
make it easier to show defaults. I changed the
declaration to #IMPLIED. OK? -elm) Temporary note:
The declarations here show defaults for the show
and actuate attributes for ease of explanation; however,
locator elements would not declare those defaults if
such inheritance is to be used. As with HyTime
architectural forms, DTD changes do not prevent
conformance so long as an actual document structure
fulfills the requirements of this specification.-->
</item>
</ulist></p>
<p>Following are sample declarations of these attributes, enclosed in a <code>
remote-resource-semantics.att</code> parameter entity.<eg>&lt;!ENTITY % remote-resource-semantics.att
  "role          CDATA               #IMPLIED
   title         CDATA               #IMPLIED
   show          (embed|replace|new) #IMPLIED
   actuate       (auto|user)         #IMPLIED
   behavior      CDATA               #IMPLIED"
></eg></p>
</div3>
<div3>
<head>Local Resource Semantics</head>
<p>The following semantic information can be provided for the local resource
of a link, if the link is inline:<ulist>
<item><p>The role of the resource, to identify to application software the
part it plays in the link</p>
<p>(Note that a link as a whole may also be given its own role, as described
in <specref ref="link-semantics-atts"/>.)</p>
<p>A link author can optionally provide role information in an attribute called <code>
content-role</code>.</p></item>
<item><p>A title for the resource, to serve as a displayable caption that
explains to users the part the resource plays in the link</p>
<p>A link author can optionally provide title information in an attribute
called <code>content-title</code>. XLink does not require that application
software make any particular use of title information.</p></item>
</ulist></p>
<p>Following are sample declarations of these attributes, enclosed in a <code>
local-resource-semantics.att</code> parameter entity.<eg>&lt;!ENTITY % local-resource-semantics.att
  "content-role  CDATA               #IMPLIED
   content-title CDATA               #IMPLIED"
></eg></p>
</div3>
</div2>
<div2 id="simple">
<head>Simple Links</head>
<p id="dt-simplelink"><termdef id="dt-simpleline" term="Simple Link"><term>
Simple links</term> can be used for purposes that approximate the functionality
of a basic HTML <code>A</code> link, but they can also support a limited amount
of additional functionality. Simple links have only one locator and thus,
for convenience, combine the functions of a linking element and a locator
into a single element.</termdef> As a result of this combination, the simple
linking element offers both a locator attribute and all the link and resource
semantic attributes.</p>
<p>Following is a sample declaration for a simple link, showing all the possible
XLink-related attributes it may have (using the parameter entities provided
in <specref ref="link-atts"/>). The <code>xml:link</code> attribute value
for a simple link must be <code>simple</code>.<eg>&lt;!ELEMENT simple ANY>
&lt;!ATTLIST simple
    xml:link      CDATA               #FIXED "simple"
    %locator.att;
    %remote-resource-semantics.att;
    %local-resource-semantics.att;
    %simple-link-semantics.att;
>

</eg></p>
<p>There are no constraints on the contents of a simple linking element. In
the sample declaration above, it is given a content model of <code>ANY</code>
to indicate that any content model or declared content is acceptable. In a
valid document, every element that is significant to XLink must still conform
to the constraints expressed in its governing DTD.</p>
<p>Following is an example of a simple link:<eg>&lt;mylink xml:link="simple" title="Citation"
   href="http://www.xyz.com/xml/foo.xml" show="new"
   content-role="Reference">as discussed in Smith(1997)&lt;/mylink></eg></p>
<p>This example <code>mylink</code> element might have the following element
and attribute-list declarations:<eg>&lt;!ELEMENT mylink (#PCDATA)>
&lt;!ATTLIST mylink
    xml:link      CDATA               #FIXED "simple"
    href          CDATA               #REQUIRED
    content-role  CDATA               #IMPLIED
></eg></p>
<p>Note that it is meaningful to have an out-of-line simple link, although
such links are uncommon. They are called "one-ended" and are typically used
to associate discrete semantic properties with locations. The properties might
be expressed by attributes on the link, the link's element type name, or in
some other way, and are not considered full-fledged resources of the link.
Most out-of-line links are extended links, as these have a far wider range
of uses.</p>
</div2>
<div2 id="extended">
<head>Extended Links</head>
<p><termdef id="dt-extendedlink" term="Extended Link">An <term>extended link
</term> differs from a simple link in that it can connect any number of resources,
not just one local resource (optionally) and one remote resource, and in that
extended links are more often out-of-line than simple links.</termdef></p>
<p>The additional capabilities of extended links are required for:<ulist>
<item><p>Enabling outgoing links in documents that cannot be modified to add
an inline link</p></item>
<item><p>Creating links to and from resources in formats with no native support
for embedded links (such as most multimedia formats)</p></item>
<item><p>Applying and filtering sets of relevant links on demand</p></item>
<item><p>Enabling other advanced hypermedia capabilities</p></item>
</ulist></p>
<p>Application software might provide traversal among all of a link's participating
resources (subject to semantic constraints outside the scope of this specification)
and might signal the fact that a given resource or sub-resource participates
in one or more links when it is displayed (even though there is no markup
at exactly that point to signal it).</p>
<p>A linking element for an extended link contains a series of <xtermref href="WD-xml-lang.html#dt-parentchild">
child elements</xtermref> that serve as locators. Because an extended link
can have more than one remote resource, it separates out linking itself from
the mechanisms used to locate each resource (whereas a simple link combines
the two).</p>
<p>The linking element itself retains those attributes relevant to the link
as a whole and to its local resource, if any. Following is a sample declaration
for an extended link (using the parameter entities provided in <specref ref="link-atts"/>).
The <code>xml:link</code> attribute value for an extended link must be <code>
extended</code>.<eg>&lt;!ELEMENT extended ANY>
&lt;!ATTLIST extended
    xml:link      CDATA               #FIXED "extended"
    %link-semantics.att;
    %local-resource-semantics.att;
></eg></p>
<p>Attributes relevant to remote resources are expressed on the corresponding
contained locator elements. Each remote resource can have its own semantics
in relation to the link as a whole. Following is a sample declaration for
a locator element, showing all the possible XLink-related attributes it may
have (using the parameter entities provided in <specref ref="link-atts"/>).
The <code>xml:link</code> attribute value for a locator element must be <code>
locator</code>.</p>
<eg>&lt;!ELEMENT locator ANY>
&lt;!ATTLIST locator
    xml:link      CDATA               #FIXED "locator"
    %locator.att;
    %remote-resource-semantics.att;
></eg>
<p>Following is an example of an out-of-line extended link:<eg>&lt;commentary xml:link="extended" inline="false">
   &lt;locator href="smith2.1" role="Essay"/>
   &lt;locator href="jones1.4" role="Rebuttal"/>
   &lt;locator href="robin3.2" role="Comparison"/>
&lt;/commentary></eg></p>
<p>For convenience, defaults for the semantic attributes on locator elements
can be specified on the linking element that contains them. If any such attribute
is omitted from a locator element, the value provided on the containing linking
element is to be used. Following is a sample declaration for an extended link
(using the parameter entities provided in <specref ref="link-atts"/>) showing
all the possible XLink-related attributes it may have, including the remote
resource semantic attributes. <eg>&lt;!ELEMENT extended ANY>
&lt;!ATTLIST extended
    xml:link      CDATA               #FIXED "extended"
    %link-semantics.att;
    %local-resource-semantics.att;
    %remote-resource-semantics.att;
></eg></p>
<p>The content of a linking element typically consists only of locator elements;
however, the declaration as <code>ANY</code> indicates that any other content
may be added. (In a valid document, every element that is significant to XLink
must still conform to the constraints expressed in its governing DTD.) Only
locator elements that are direct children of the linking element define resources
linked by that linking element.</p>
<p>A key issue with out-of-line extended links is how linking application
software can manage and find them, particularly when they are stored in completely
separate documents from those in which their participating resources appear.
XLink provides a mechanism for identifying relevant link-containing documents,
which is discussed in <specref ref="xlg"/>.</p>
</div2>
</div1>
<div1 id="xlg">
<head>Extended Link Groups</head>
<p>Hyperlinked documents are often best processed in groups rather than one
at a time. If it is desired to highlight resources to advertise that traversal
can be initiated, and if at the same time <termref def="dt-outofline">out-of-line
</termref> links are being used, it may be an absolute requirement to read
other documents to find these links and discover where the resources are.
</p>
<p><termdef id="dt-xlg" term="Extended Link Group">In these cases, an <term>
extended link group</term> element, a special kind of extended link, may be
used to store a list of links to other documents that together constitute
an interlinked group.</termdef> <termdef id="dt-xld" term="Extended Link Document">
Each such document is identified by means of an <term>extended link document
</term> element, a special kind of locator element.</termdef></p>
<p>Following are sample declarations for extended link group and extended
link document elements, showing all the possible XLink-related attributes
they may have (using the parameter entities provided in <specref ref="link-atts"/>).
The <code>xml:link</code> attribute value for an extended link group element
must be <code>group</code>, and the value for an extended link document element
must be <code>document</code>.<eg>&lt;!ELEMENT group (document*)>
&lt;!ATTLIST group
    xml:link      CDATA               #FIXED "group"
    steps         CDATA               #IMPLIED
>
&lt;!ELEMENT document EMPTY>
&lt;!ATTLIST document
    xml:link      CDATA               #FIXED "document"
    %locator.att;
></eg></p>
<!--Examples sorely needed here! -elm-->
<p>The <code>steps</code> attribute may be used by an author to help deal
with the situation where an extended link group directs application software
to locate another document, which proves to contain an extended link group
of its own. There is a potential for infinite regress, and yet there are situations
where processing several levels of extended link groups is useful. The <code>
steps</code> attribute should have a numeric value that serves as a hint from
the author to any link processor as to how many steps of extended link group
processing should be undertaken. It does not have any normative effect.</p>
<p>For example, should a group of documents be organized with a single "hub"
document containing all the out-of-line links, it might make sense for each
non-hub document to contain an extended link group containing only one reference
to the hub document. In this case, the best value for <code>steps</code> would
be <code>2</code>.</p>
</div1>
<div1 id="behavior">
<head>Link Behavior</head>
<p>Link formatting and link behavior are inextricably connected. In general,
formatting involves the appearance or treatment of the link prior to any user
action, such as choice of font, color, icons, and other devices to show that
a link is present. Behavior focuses on what happens when the link is traversed,
such as opening, closing, or scrolling windows or panes; displaying the data
from various resources in various ways; testing, authenticating, or logging
user and context information; or executing various programs.</p>
<p>XLink does not provide mechanisms for controlling link formatting because
it is considered to fall into the domain of stylesheets. Link behavior should
ideally also be determined by rules based on link types, resource roles, user
circumstances, and other factors. However, XLink does provide a few very general
behavior mechanisms because they are commonly considered to reflect major
or invariant semantics of link types.</p>
<p>The mechanism that XLink provides allows link authors to signal certain
intentions as to the timing and effects of traversal. Such intentions can
be expressed along two axes, labeled <code>show</code> and <code>actuate</code>.
These are used to express <emph>policies</emph> rather than <emph>mechanisms
</emph>; any link-processing application software is free to devise its own
mechanisms, best suited to the user environment and processing mode, to implement
the requested policies.</p>
<p>In many cases, much finer control over the details of traversal behavior,
of the type that existing hypertext software typically provides, will be desired.
Such fine control of link behavior is outside the scope of this specification.
However, the <code>behavior</code> attribute is provided as a standard place
for authors to provide, and in which application software may look, for detailed
behavioral instructions.</p>
<div2>
<head>The "Show" Axis</head>
<p>The <code>show</code> <xtermref href="WD-xml-lang.html#dt-attr">attribute
</xtermref> is used to express a policy as to the context in which a resource
that is traversed to should be displayed or processed. It may take one of
three values: <glist>
<gitem><label><code>embed</code></label>
<def>
<p>Indicates that upon traversal of the link, the designated resource should
be embedded, for the purposes of display or processing, in the body of the
resource and at the location where the traversal started.</p>
</def></gitem>
<gitem><label><code>replace</code></label>
<def>
<p>Indicates that upon traversal of the link, the designated resource should,
for the purposes of display or processing, replace the resource where the
traversal started.</p>
</def></gitem>
<gitem><label><code>new</code></label>
<def>
<p>Indicates that upon traversal of the link, the designated resource should
be displayed or processed in a new context, not affecting that of the resource
where the traversal started.</p>
</def></gitem>
</glist></p>
</div2>
<div2>
<head>The "Actuate" Axis</head>
<p>The <code>actuate</code> attribute is used to express a policy as to when
traversal of a link should occur. It may take one of two values: <glist>
<gitem><label><code>auto</code></label>
<def>
<p>Indicates that the resource in question should be retrieved when any of
the other resources of the same link is encountered, and that the display
or processing of the initiating resource is not considered complete until
this is done. All auto resources are retrieved in the order specified.</p>
</def></gitem>
<gitem><label><code>user</code></label>
<def>
<p>Indicates that the resource should not be presented until there is an explicit
external request for traversal.</p>
</def></gitem>
</glist></p>
</div2>
<div2>
<head>Combinations of the "Show" and "Actuate" Axes</head>
<p>Each combination of the <code>show</code> and <code>actuate</code> attributes
is meaningful. Perhaps the least obvious is <code>show="replace"</code> combined
with <code>actuate="auto"</code>; this could be used in "forwarding" type
applications, where when one anchor is display, the other(s) are to replace
it without user intervention. Since XLink provides only the most general semantics
for links, details of presentation, such as a time delay or beep before forwarding,
can be specified on a per-application basis using a style language.</p>
<!--Need more detail here. -elm-->
</div2>
</div1>
<div1 id="remapping">
<head>Attribute Remapping</head>
<!--need to move this whole section ... maybe even
to an appendix, and with pseudocode example? Sjd Like:
If (val=getattr('role'))!=NIL
then return val
else if (map=getattr('xml:attributes'))==NIL
then return NIL
else
for n
= 1 to numwords(map) by 2
if word(map,n) = 'role' then
return
getattr(word(map,n))
next n
return NIL endif -->
<p>XLink provides many attributes that can be attached to linking elements
to describe various aspects of links, and each has a default name. It may
be desired to use existing elements in XML documents as linking elements,
but such elements might already have attributes whose names conflict with
those described in this document. To avoid collisions, user-chosen attribute
names can be mapped to the default names using the <code>xml:attributes</code>
attribute.</p>
<p>This attribute must contain an even number of white-space-separated names,
which are treated as pairs. In each pair, the first name must be one of the
default XLink names (<code>role</code>, <code>href</code>, <code>title</code>, <code>
show</code>, <code>inline</code>, <code>content-role</code>, <code>content-title
</code>, <code>actuate</code>, <code>behavior</code>, <code>steps</code>).
The second name, when recognized in the document, will be treated as though
it were playing the role assigned to the first. For example, consider a DTD
with the following declaration: <eg>&lt;!ELEMENT TEXT-BOOK ANY>
&lt;!ATTLIST TEXT-BOOK
        title      CDATA                #IMPLIED
        role       (PRIMARY|SUPPORTING) #IMPLIED
></eg></p>
<p>If it were desired to use this as a simple link, it would be necessary
to remap a couple of attributes. This could be accomplished in the internal
subset: <eg>&lt;!ATTLIST TEXT-BOOK
        xml:link       CDATA            #FIXED "simple"
        xml:attributes CDATA
                       #FIXED "title xl-title role xl-role"
></eg></p>
<p>Then in the document, the following would be recognized as a simple link: <eg>
&lt;TEXT-BOOK title="Compilers: Principles, Techniques, and Tools"
           role="PRIMARY" xl-title="Primary Textbook for the Course"
           xl-role="ONLINE-PURCHASE"
           href="/cgi/auth-search?q="+Aho+Sethi+Ullman"/></eg></p>
</div1>
<div1>
<head>Conformance</head>
<p>An element conforms to XLink if:<olist>
<item><p>The element has an <code>xml:link</code> attribute whose value is
one of the attribute values prescribed by this specification, and</p></item>
<item><p>the element and all of its attributes and content adhere to the syntactic
requirements imposed by the chosen <code>xml:link</code> attribute value,
as prescribed in this specification.</p></item>
</olist></p>
<p>Note that conformance is assessed at the level of individual elements,
rather than whole XML documents, because XLink and non-XLink linking mechanisms
may be used side by side in any one document.</p>
<p>An application conforms to XLink if it interprets XLink-conforming elements
according to all required semantics prescribed by this specification and,
for any optional semantics it chooses to support, supports them in the way
prescribed.   
<!--If/when we split out the XLinkfunctionality
(e.g. inline links and out-of-line links), the
conformance language will have to address the different
levels of support. -elm-->
</p>
</div1>
</body><back>
<div1 id="unfinished">
<head>Unfinished Work</head>
<div2>
<head>Structured Titles</head>
<p>The simple title mechanism described in this draft is insufficient to cope
with internationalization or the use of multimedia in link titles. A future
version will provide a mechanism for the use of structured link titles.</p>
</div2>
</div1>
<div1>
<head>References</head>
<blist>
<bibl id="xptr" key="XPTR">Eve Maler and Steve DeRose, editors. <titleref>
XML Pointer Language (XPointer) V1.0</titleref>. ArborText, Inso, and Brown
University. Burlington, Seekonk, et al.: World Wide Web Consortium, 1998.
(See <loc href="http://www.w3.org/TR/WD-xptr">http://www.w3.org/TR/WD-xptr
</loc>.)</bibl>
<bibl id="iso10744" key="ISO/IEC 10744">ISO (International Organization for
Standardization). <titleref>ISO/IEC 10744-1992 (E).  Information technology &mdash;Hypermedia/Time-based
Structuring Language (HyTime).</titleref> [Geneva]:  International Organization
for Standardization, 1992. <titleref>Extended Facilities Annex.</titleref>
[Geneva]:  International Organization for Standardization, 1996. (See <loc
href="http://www.ornl.gov/sgml/wg8/hytime/html/is10744r.html">http://www.ornl.gov/sgml/wg8/hytime/html/is10744r.html
</loc>   
<!--p m-r says this link is broken. elm-->
).</bibl>
<bibl id="rfc1738" key="IETF RFC 1738">IETF (Internet Engineering Task Force). <titleref>
RFC 1738:  Uniform Resource Locators</titleref>. 1991. (See <loc href="http://www.w3.org/Addressing/rfc1738.txt">
http://www.w3.org/Addressing/rfc1738.txt</loc>).</bibl>
<bibl id="rfc1808" key="IETF RFC 1808">IETF (Internet Engineering Task Force). <titleref>
RFC 1808:  Relative Uniform Resource Locators</titleref>. 1995. (See <loc
href="http://www.w3.org/Addressing/rfc1808.txt">http://www.w3.org/Addressing/rfc1808.txt
</loc>).</bibl>
<bibl id="tei" key="TEI">C. M. Sperberg-McQueen and Lou Burnard, editors. <titleref>
Guidelines for Electronic Text Encoding and Interchange</titleref>. Association
for Computers and the Humanities (ACH), Association for Computational Linguistics
(ACL), and Association for Literary and Linguistic Computing (ALLC). Chicago,
Oxford:  Text Encoding Initiative, 1994.   
<!-- add cite to DOM work -->
</bibl>
<bibl id="chum" key="CHUM">Steven J. DeRose and David G. Durand. 1995. "The
TEI Hypertext Guidelines." In <titleref>Computing and the Humanities </titleref>29(3).
Reprinted in <titleref>Text Encoding Initiative: Background and Context</titleref>,
ed. Nancy Ide and Jean Véronis, ISBN 0-7923-3704-2.</bibl>
</blist></div1>
</back></spec>
<?Pub *0000049154?>
