<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE spec PUBLIC "-//W3C//DTD Specification V2.1//EN" "http://www.w3.org/XML/1998/06/xmlspec-v21.dtd" [
<!--ArborText, Inc., 1988-2000, v.4002-->
<!ENTITY iso6.doc.date "20001220">
<!ENTITY linkbaselistprop "http://www.w3.org/1999/xlink/properties/linkbase">
<!ENTITY showactuateattribs "xlink:show      (new
                  |replace
                  |embed
                  |other
                  |none)          #IMPLIED
  xlink:actuate   (onLoad
                  |onRequest
                  |other
                  |none)          #IMPLIED">
<!ENTITY fromtoatts "xlink:from      NMTOKEN         #IMPLIED
  xlink:to        NMTOKEN         #IMPLIED">
<!ENTITY hrefatt "xlink:href      CDATA           ">
<!ENTITY arcroleatt "xlink:arcrole   CDATA           #IMPLIED">
<!ENTITY labelatt "xlink:label     NMTOKEN         #IMPLIED">
<!ENTITY roleatt "xlink:role      CDATA           #IMPLIED">
<!ENTITY nsatt 'xmlns:xlink     CDATA           #FIXED "&xlinknsuri;"'>
<!ENTITY titleatt "xlink:title     CDATA           #IMPLIED">
<!ENTITY xmproleuri "http://www.example.com/linkprops/">
<!ENTITY graphic-loc "c:/my-documents/epicuser/xlink/">
<!ENTITY xlinknsuri "http://www.w3.org/1999/xlink">
]>
<?Pub UDT _bookmark _target?>
<spec w3c-doctype="note" status="int-review">
<!--
Last edited: 19 December 2000 by ht
File prepared with XED
-->
<header>
<title>XLink Markup Name Control</title>
<w3c-designation> NOTE-xlink-naming-&iso6.doc.date;</w3c-designation>
<w3c-doctype>W3C Note</w3c-doctype>
<pubdate><day>19</day><month>December</month><year>2000</year></pubdate>
<publoc><loc href="http://www.w3.org/TR/2000/NOTE-xlink-naming-&iso6.doc.date;">http://www.w3.org/TR/2000/NOTE-xlink-naming-&iso6.doc.date;</loc></publoc>
<latestloc><loc href="http://www.w3.org/TR/xlink-naming">http://www.w3.org/TR/xlink-naming</loc></latestloc>
 <prevlocs>
  <loc href="http://www.w3.org/TR/2000/NOTE-xlink-naming-20001024/">http://www.w3.org/TR/2000/NOTE-xlink-naming-20001024/</loc>
 </prevlocs>
<authlist>
<author><name>Eve Maler</name><affiliation>Sun Microsystems</affiliation>
<email href="mailto:elm@east.sun.com">eve.maler@east.sun.com</email></author>
<author><name>Daniel Veillard</name><affiliation>W3C</affiliation><email href="mailto:bent@exemplary.net">veillard@w3.org</email>
</author>
 <author>
  <name>Henry S. Thompson</name>
  <affiliation>University of Edinburgh</affiliation>
  <email href="mailto:ht@cogsci.ed.ac.uk">ht@cogsci.ed.ac.uk</email>
 </author>
</authlist>
<abstract>
<p>This document proposes a possible XML Schema-based solution to the need
to use XLink in XML-based languages such as XHTML 1.0.</p>
</abstract>
<status>
<p>This Note is available for W3C-member review. It has been produced by the
three editors, who are co-chairs of the XML Linking Working Group and editor of
part of the XML Schema spec. respectively. This Note
has not been approved by the group or taken up as a work item.</p>
<p>No commitment is made to update this Note. However, if you have comments,
please send them to the editors.</p>
<p>A list of current W3C Recommendations and other technical documents can
be found at <loc href="http://www.w3.org/TR">http://www.w3.org/TR</loc>.</p>
</status>
<pubstmt>
<p>Burlington et al.: World-Wide Web Consortium, XML Working Group and XML
Linking Working Group, 2000.</p>
</pubstmt>
<sourcedesc>
<p>Created in electronic form.</p>
</sourcedesc>
<langusage>
<language id="en">English</language>
</langusage>
<revisiondesc>
<slist>
<sitem>20000901: Skeleton draft by elm.</sitem>
<sitem>20000901: A few comments from DV incorporated. elm</sitem>
<sitem>20000911: Scaled back the content. elm</sitem>
<sitem>20000922: Added examples of how the schema module could be used. elm</sitem>
<sitem>20000922: Corrected schema according to HT's instructions; removed
&ldquo;legacy&rdquo;; corrected XHTML markup. elm</sitem>
 <sitem>20001912: Added additional features to address attribute grouping. ht</sitem>
</slist>
</revisiondesc>
</header>
<body>
<div1>
<head>Problem Statement</head>
<p>This document proposes a possible XML Schema-based solution to the need
to use XLink in XML-based languages such as XHTML 1.0.</p>
<p>XLink is a vocabulary that allows you to add hyperlinking to any XML document.
In order to use it, you add XLink-namespaced attributes to elements of your
own design. For example, say the following <el>cmd</el> element normally just
indicates the name of a command in text, so it can be highlighted:</p>
<eg>&lt;doc xmlns="http://example.com/myvocab">
...
&lt;p>See &lt;cmd>grep&lt;/cmd> for more information.&lt;/p>
...
&lt;/doc></eg>
<p>If you wanted to turn it into an XLink hyperlink, you would add a series
of attributes to make it be recognized as such and to provide the relevant
linking information:</p>
<eg>&lt;doc
  xmlns="http://example.com/myvocab"
  xmlns:xlink="http://www.w3.org/1999/xlink">
...
&lt;p>See &lt;cmd
  xlink:type="simple"
  xlink:href="manpages.xml#grep1">grep&lt;/cmd> for 
more information.&lt;/p>
...
&lt;/doc></eg>
<p>A problem arises if you already have some marked-up information that provides
some of the same kinds of linking information that XLink is designed to provide.
For example, if you have an XHTML document that links the word <quote>grep</quote>
with the <code>grep</code> manpage, you already provide a URI reference pointing
to your desired target in XHTML's own <att>href</att> attribute:</p>
<eg>&lt;html>
...
&lt;p>See &lt;a href="manpages.xml#grep1">grep&lt;/a> for 
more information.&lt;/p>
...
&lt;/html></eg>
<p>In order to incorporate XLink usage directly into this vocabulary as a
first-class construct, you would have to force the vocabulary to undergo a
backwards-incompatible change from <att>href</att> to <att>xlink:href</att>.
XLink's attributes must have namespace prefixes on them because of the way
XML namespaces work; <quote>global</quote> attributes that can be attached
to any element must be prefixed because they cannot identify themselves in
any other way.</p>
</div1>
<div1 id="datatypes">
<head>Schema Datatypes as a Future Solution</head>
<p>XML Schema could be useful in handling XML documents that want to use XLink
but already provide link information in a form that is incompatible with XLink.</p>
<p>Currently, XLink requires applications to recognize a particular set of
attribute names in the XLink namespace in order to do their work, but an imagined
future version of XLink (here called <quote>Schema-XLink</quote> to avoid
any confusion) might allow them to take advantage of XML Schema datatypes
instead, or in addition, as a way to recognize Schema-XLink data. The idea
is that any attribute name could be used, as long as the attribute were <quote>marked</quote>
with an appropriate datatype, made available through a post-schema-validation
information set or by other means. This idea was originally suggested by Henry
Thompson of the XML Schema Working Group.</p>
<p>If Schema-XLink were to define such datatypes, it could provide a normative
XML Schema module that merely contains a series of type definitions. (Note,
however, that as of this writing, XML Schema does not have facilities to specify
additional normative constraints of the style that XLink needs; prose would
still be needed to specify the combinations of attribute types that are expected
to appear on particular <quote>XLink element types.</quote>) It is likely
that most vocabularies choosing to use these simple datatypes would incorporate
the Schema-XLink schema module into a higher-level schema that defines stricter
rules as necessary.</p>
<p>Following is how the Schema-XLink module might look.</p>
<note>
<p>This schema example is non-normative. This Note cannot dictate what problems
future XML Linking Working Groups will be chartered to solve, nor what solutions
they will use to solve them.</p>
</note>
<eg>&lt;?xml version='1.0' encoding='UTF-8'?>
&lt;!DOCTYPE schema PUBLIC "-//W3C//DTD XMLSCHEMA 200010//EN"
                 "http://www.w3.org/2000/10/XMLSchema.dtd" >
&lt;schema xmlns="http://www.w3.org/2000/10/XMLSchema"
        xmlns:xl="http://www.w3.org/2000/10/schema-xlink"
        targetNamespace="http://www.w3.org/2000/10/schema-xlink">

 &lt;simpleType name="type">
  &lt;restriction base="NMTOKEN">
   &lt;enumeration value="simple"/>
   &lt;enumeration value="extended"/>
   &lt;enumeration value="locator"/>
   &lt;enumeration value="arc"/>
   &lt;enumeration value="resource"/>
   &lt;enumeration value="title"/>
   &lt;enumeration value="none"/>
  &lt;/restriction>
 &lt;/simpleType>

 &lt;simpleType name="href">
  &lt;restriction base="uriReference"/>
 &lt;/simpleType>

 &lt;simpleType name="role">
  &lt;restriction base="uriReference"/>
 &lt;/simpleType>
 
 &lt;simpleType name="arcrole">
  &lt;restriction base="xl:role"/>
 &lt;/simpleType>

 &lt;simpleType name="title">
  &lt;restriction base="CDATA"/>
 &lt;/simpleType>

 &lt;simpleType name="show">
  &lt;restriction base="NMTOKEN">
   &lt;enumeration value="new"/>
   &lt;enumeration value="replace"/>
   &lt;enumeration value="embed"/>
   &lt;enumeration value="other"/>
   &lt;enumeration value="none"/>
  &lt;/restriction>
 &lt;/simpleType>

 &lt;simpleType name="actuate">
  &lt;restriction base="NMTOKEN">
   &lt;enumeration value="onLoad"/>
   &lt;enumeration value="onRequest"/>
   &lt;enumeration value="other"/>
   &lt;enumeration value="none"/>
  &lt;/restriction>
 &lt;/simpleType>

 &lt;simpleType name="label">
  &lt;restriction base="NMTOKEN"/>
 &lt;/simpleType>
 
 &lt;simpleType name="from">
  &lt;restriction base="xl:label"/>
 &lt;/simpleType>
 
 &lt;simpleType name="to">
  &lt;restriction base="xl:label"/>
 &lt;/simpleType>
&lt;/schema></eg>
<p>If a higher-level vocabulary were to layer itself on top of Schema-XLink,
it could then use the schema module as follows. This example is for a fictional
vocabulary that has <el>a</el> and <el>img</el> elements that are somewhat
similar to XHTML's elements of the same name. It assigns fixed values to the
elements' attributes, so that users of the vocabulary don't need to set them
explicitly; in this way, it relies on XLink processing to get the desired <att>show</att>
and <att>actuate</att> behavior. It also defines a complex type, <code>myLink</code>,
that provides constraints for what might be called the <quote>basics</quote>
of an XLink simple linking element. The <code>myLink</code> type meets the
needs of this schema, but might be too constraining for some other schema
that wishes to be Schema-XLink-conforming.</p>
<eg>&lt;?xml version='1.0' encoding='UTF-8'?>
&lt;!DOCTYPE schema PUBLIC "-//W3C//DTD XMLSCHEMA 200010//EN"
                        "http://www.w3.org/2000/10/XMLSchema.dtd" >
&lt;schema xmlns="http://www.w3.org/2000/10/XMLSchema"
        xmlns:myvocab="http://www.example.com/myvocab"
        xmlns:xl="http://www.w3.org/2000/10/schema-xlink"
        targetNamespace="http://www.example.com/myvocab">
 
 &lt;import namespace="http://www.w3.org/2000/09/xlink"/>
 
 &lt;element name="doc">
  &lt;complexType mixed="true">
   &lt;choice minOccurs="0" maxOccurs="unbounded">
    &lt;element ref="myvocab:a"/>
    &lt;element ref="myvocab:img"/>
   &lt;/choice>
  &lt;/complexType>
 &lt;/element>
 
 &lt;complexType name="myLink">
  &lt;simpleContent>
   &lt;extension base="CDATA">
    &lt;attribute name="xltype" type="xl:type" use="fixed" value="simple"/>
    &lt;attribute name="href" type="xl:href"/>
    &lt;attribute name="target" type="xl:show"/>
    &lt;attribute name="visit" type="xl:actuate"/>
   &lt;/extension>
  &lt;/simpleContent>
 &lt;/complexType>
 
 &lt;element name="a">
  &lt;complexType>
   &lt;complexContent>
    &lt;restriction base="myvocab:myLink">
     &lt;attribute name="target" type="xl:show" use="fixed" value="replace"/>
     &lt;attribute name="visit" type="xl:actuate" use="fixed" value="onRequest"/>
    &lt;/restriction>
   &lt;/complexContent>
  &lt;/complexType>
 &lt;/element>
 
 &lt;element name="img">
  &lt;complexType>
   &lt;complexContent>
    &lt;restriction base="myvocab:myLink">
     &lt;attribute name="target" type="xl:show" use="fixed" value="embed"/>
     &lt;attribute name="visit" type="xl:actuate" use="fixed" value="onLoad"/>
    &lt;/restriction>
   &lt;/complexContent>
  &lt;/complexType>
 &lt;/element>

&lt;/schema></eg>
<p>Instead of creating <att>target</att> and <att>visit</att> attributes to
hold fixed values for the traversal behavior for each element type, this vocabulary
could have conveyed the desired behavior semantics in ways that would require
a <code>myvocab</code> processor to act itself (possibly through communicating
with an XLink processor, if the desired behavior is simple enough to fit within
XLink's behavior axes). For example:</p>
<ulist>
<item><p>The element type names could be sufficient, since there are only
two elements and their desired traversal behaviors are distinct.</p></item>
<item><p>If the vocabulary had several elements, with some sharing the same
set of traversal behaviors, their declarations could share a named complex
type that would convey the desired behavior.</p></item>
<item><p>If the complex type solution is used, instead of merely using the
type name to convey the desired behavior, each type could set up attributes
with fixed values as shown above.</p></item>
<item><p>Or each complex type could set up an attribute of type <code>xl:arcrole</code>
and give it a value that corresponds to an RDF property.</p></item>
</ulist>
</div1>
 <div1 id="extend">
  <head>Extending the Schema to Support Multiple Links</head>
  <p>The examples in the previous section were relatively simple to accommodate
in that the elements involved had only a single <code>href</code>-type attribute.  This may of
course not always be the case.  We explore here to alternative approaches to
supporting a schema-based approach to signalling link semantics when multiple
linking attributes are involved, as for example is the case for XHTML's
<code>IMG</code> tag, which has <code>longdesc</code> and <code>usemap</code>
<code>href</code>-type attributes in addition to <code>src</code>.</p>
  <p>The primary difficulty in extending the solution proposed in the previous
section to the case of multiple links lies not in identifying the <code>href</code>-type
attributes (the <code>xlink:href</code> simple type can be used for all of
them) but in establishing the semantics of these links, that is, in identifying
their <code>show</code>, <code>actuate</code>, <code>arcrole</code>, etc.  We
propose two possible solutions to this problem below, one simpler, but limited,
and the other completely general, but more complex.</p>
  <div2 id="encode">
   <head>Encoding semantics in the type name</head>
   <p>In this approach, we provide for the most common cases by allowing the
choice of simple type for the <code>href</code>-type attributes to not only
identify them as such, but also to signal their <code>show</code> and
<code>actuate</code>, by providing twenty synonyms for <code>xlink:href</code>:</p>
   <eg><![CDATA[<schema xmlns="http://www.w3.org/2000/10/XMLSchema"
        xmlns:xl="http://www.w3.org/2000/10/xlink-ns"
        targetNamespace="http://www.w3.org/2000/10/xlink-ns">
 <simpleType name="href-new">
  <annotation>
   <documentation>Corresponds to show='new' actuate='none'</documentation>
  </annotation>
  <restriction base="xl:href"/>
 </simpleType>

 <simpleType name="href-new-onLoad">
  <annotation>
   <documentation>Corresponds to show='new' actuate='onLoad'</documentation>
  </annotation>
  <restriction base="xl:href"/>
 </simpleType>
 . . .
</schema>]]>
   </eg>
   <p>Were such types to be provided in the XML Schema for XLink, then the
<code>myvocab</code> example schema in section <specref ref="datatypes"/> could
be both simplified in expression and extended in coverage as follows:</p>
   <eg><![CDATA[<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE schema PUBLIC "-//W3C//DTD XMLSCHEMA 200010//EN"
                        "http://www.w3.org/2000/10/XMLSchema.dtd" >
<schema xmlns="http://www.w3.org/2000/10/XMLSchema"
        xmlns:myvocab="http://www.example.com/myvocab"
        xmlns:xl="http://www.w3.org/2000/10/xlink-ns"
        targetNamespace="http://www.example.com/myvocab">
 
 <import namespace="http://www.w3.org/2000/10/xlink-ns"/>
 
 <element name="doc">
  <complexType mixed="true">
   <choice minOccurs="0" maxOccurs="unbounded">
    <element ref="myvocab:a"/>
    <element ref="myvocab:img"/>
   </choice>
  </complexType>
 </element>
 
 <element name="a">
  <complexType>
   <attribute name="xltype" type="xl:type" use="fixed" value="simple"/>
   <attribute name="href" type="xl:href-replace-onRequest"/>
  </complexType>
 </element>
 
 <element name="img">
  <complexType>
   <attribute name="xltype" type="xl:type" use="fixed" value="extended"/>
   <attribute name="src" type="xl:href-embed-onLoad"/>
   <attribute name="longdesc" type="xl:href-new-onRequest"/>
  </complexType>
 </element>

</schema>
]]></eg>
   <p>This solution is attractive in its simplicity, but it does require
conformant processors to decode the twenty typenames and act as if the implied
<code>show</code> and <code>actuate</code> attributes were present.  It also
cannot be extended to the other XLink attributes such as <code>arcrole</code>
or <code>title</code>, as these do not have a closed set of possible values.</p>
  </div2>
  <div2 id="arcIndex">
   <head>Using schema annotation to group XLink attributes</head>
   <p>Using the provision in XML Schema for annotating declarations with
attributes from user-specified namespaces, we can provide a general solution to
the problem, at the cost of requiring additional schema-sophistication on the
part of processors.  We add a single attribute declaration to the XLink schema
itself, as follows:</p>
   <eg><![CDATA[<attribute name="arcIndex" type="positiveInteger"/>]]></eg>
   <p>Then in application schemas with multiple arcs encoded on a single tag,
we annotate the <emph>declarations</emph> of the XLink-related attributes with
an <code>arcIndex</code>, as follows:</p>
   <eg><![CDATA[<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE schema PUBLIC "-//W3C//DTD XMLSCHEMA 200010//EN"
                        "http://www.w3.org/2000/10/XMLSchema.dtd" >
<schema xmlns="http://www.w3.org/2000/10/XMLSchema"
        xmlns:myvocab="http://www.example.com/myvocab"
        xmlns:xl="http://www.w3.org/2000/10/xlink-ns"
        targetNamespace="http://www.example.com/myvocab">
 
 <import namespace="http://www.w3.org/2000/10/xlink-ns"/>
 
 <element name="doc">
  <complexType mixed="true">
   <choice minOccurs="0" maxOccurs="unbounded">
    <element ref="myvocab:a"/>
    <element ref="myvocab:img"/>
   </choice>
  </complexType>
 </element>
 
 <element name="a">
  <complexType>
   <attribute name="xltype" type="xl:type" use="fixed" value="simple"/>   
   <attribute name="s1" type="xl:show" use="fixed" value="replace"/>
   <attribute name="a1" type="xl:actuate" use="fixed" value="onRequest"/>
   <attribute name="href" type="xl:href"/>
  </complexType>
 </element>
 
 <element name="img">
  <complexType>
   <attribute name="xltype" type="xl:type" use="fixed" value="extended"/>
   <attribute name="src" type="xl:href"
              xl:arcIndex="1"/>  
   <attribute name="s1" type="xl:show" use="fixed" value="embed"
              xl:arcIndex="1"/>
   <attribute name="a1" type="xl:actuate" use="fixed" value="onLoad"
              xl:arcIndex="1"/>
   <attribute name="t1" type="xl:title" use="fixed" value="The picture itself"
              xl:arcIndex="1"/>
   <attribute name="longdesc" type="xl:href"
              xl:arcIndex="2"/>  
   <attribute name="s2" type="xl:show" use="fixed" value="new"
              xl:arcIndex="2"/>
   <attribute name="a2" type="xl:actuate" use="fixed" value="onRequest"
              xl:arcIndex="2"/>
   <attribute name="t2" type="xl:title" use="fixed" value="A long caption"
              xl:arcIndex="2"/>
  </complexType>
 </element>

</schema>
]]></eg>
   <p>The result of these declarations is that in the post schema-validation
infoset not only will all the <code>fixed</code> semantic indicator attribute values be available,
but each will be keyed to the appropriate <code>href</code> by the
<code>arcIndex</code> annotation, which is present on each relevant attribute
information item.</p>
  </div2>
 </div1>
</body><back>
<div1>
<head>Other Potential Solutions </head>
<p>Besides a potential schema solution, there are other potential solutions
that do not require a backwards-incompatible change to the vocabulary in question;
however, they are outside the scope of this document. Nevertheless, t<?Pub Caret?>o
convey a sense of the alternatives, here are some possibilities phrased in
terms of XHTML:</p>
<ulist>
<item><p>Put <att>xlink:href</att> alongside <att>href</att> with the same
value, so that each could be used by its respective processor. This would
be better as a transition strategy than as a long-term solution.</p></item>
<item><p>Build a transformation into XLink-compliant form into the expected
processing of XHTML.</p></item>
<item><p>Harvest third-party XLink links from the XHTML and use an XLink processor
to operate on them as an expected part of XHTML processing.</p></item>
</ulist>
</div1>
</back></spec>
<?Pub *0000014114?>
