graphic with four colored squares
Cover page images (keys)

Linking (XLink, XML Base, XPointer)

01 Sep 2005

Ivan Herman, W3C

Linking (XLink, XML Base, XPointer)

Slides of the presentation …

(If your browser has proper implementation of the object element of XHTML (e.g., Mozilla’s Firefox) and you have a SVG plugin installed, you might want to use the same slideset using SVG. Some of the images may have added interaction and they also rescale better…)

Table of Contents:

  1. XML Linking facilities
  2. XHTML linking
  3. XLink
  4. Simple XLink Example
  5. Global Attributes
  6. Simple link example
  7. Simplification via DTD
  8. XLink types
  9. Example: Student's Workplan
  10. Simplification via DTD
  11. Simplified: Student's Workplan
  12. Student's Workplan (cont.)
  13. XPointer Framework
  14. XPointer Framework (cont)
  15. XPointer Framework (cont)
  16. Namespaces
  17. Element Scheme
  18. Why not XPath
  19. XBase

XML Linking facilities

Three recommendations to provide advanced linking facilities:

XHTML linking

XLink

Simple XLink Example

<ABC xlink:type="simple" xlink:href="http://www.w3.org/">The W3C</ABC>

Global Attributes

Simple link example

<ABC
  xlink:type    = "simple"
  xlink:href    = "http://www.w3.org/"
  xlink:role    = "w3chome"
  xlink:title   = "W3C Home Page"
  xlink:show    = "replace"
  xlink:actuate = "onRequest">
    The W3C
</ABC>

Simplification via DTD

<ABC
  xlink:href    = "http://www.w3.org/"
  xlink:role    = "w3chome"
  xlink:title   = "W3C Home Page">
    The W3C
</ABC>

XLink types

simple
Defines a link that is an extension of HTML <a>
extended
Connect any number of resources. It contains:
locator
remote resource participating in an extended link (using URI)
resource
local resource used by the extended link
arc
traversal semantics of the participating resources in an extended link (direction, show, actuate, etc)
title
human readable labels for links

Defines a general “link table”

Example: Student's Workplan

<workplan xlink:title="Nevada Barr's workplan" xlink:type="extended">
  <relation xlink:type="arc" xlink:from="student" xlink:to="course"/>
  <relation xlink:type="arc" xlink:from="student" xlink:to="advisor"/>
  <relation xlink:type="arc" xlink:from="marks"   xlink:to="student"/>
  <data xlink:type="locator" xlink:role="student" 
     xlink:href="http://brunel.ac.uk/sr1003.xml"/>
  <data xlink:type="locator" xlink:role="course"
     xlink:href="http://brunel.ac.uk/cs5011A.xml"/>
  <data xlink:type="locator" xlink:role="course"
     xlink:href="http://brunel.ac.uk/cs5012A.xml"/>
  <data xlink:type="locator" xlink:role="advisor"
     xlink:href="http://brunel.ac.uk/advisor/smith.xml"/>
  <marks xlink:type="resource" xlink:role="marks"
     xlink:label="marks.html">7.8</marks>
</workplan>

Note that

Simplification via DTD

XLink usage in XML can be simplifed by:

Simplified: Student's Workplan

 <workplan xlink:title="Nevada Barr's workplan"> 
  <relation xlink:from="student" xlink:to="course"/>
  <relation xlink:from="student" xlink:to="advisor"/>
  <relation xlink:from="marks"   xlink:to="student"/>
  <student xlink:href="http://brunel.ac.uk/sr1003.xml" />
  <course  xlink:href="http://brunel.ac.uk/cs5011A.xml"/>
  <course  xlink:href="http://brunel.ac.uk/cs5012A.xml"/>
  <advisor xlink:href="http://brunel.ac.uk/advisor/smith.xml"/>
  <marks   xlink:label="marks.html">7.8</marks>
 </workplan>

Student's Workplan (cont.)

A workplan as an example for an extended link

XPointer Framework

http://a.b.c#q
http://a.b.c#scheme1(desc1) scheme2(desc2)

XPointer Framework (cont)

http://a.b.c#svgView(viewBox(...))

XPointer Framework (cont)

Namespaces

#xmlns(img=http://example.org/image)img:rect(10,10,50,50)

Element Scheme

http://a.b.c#element(something)
http://a.b.c#something
http://a.b.c#element(something/3/1)

Why not XPath

XBase

Provides equivalent functionality to HTML BASE element

Showing XBase: left side an xml fragment, right side some explanation