XML.com: XML From the Inside Out
oreilly.comSafari Bookshelf.Conferences.


What Is XLink

September 18, 2000

"Only connect! That was the whole of the sermon"
                 -- E. M. Forster (1879 - 1970)

The very nature of the success of the Web lies in its capability for linking resources. However, the unidirectional, simple linking structures of the Web today are not enough for the growing needs of an XML world. The official W3C solution for linking in XML is called XLink (XML Linking Language). This article explains its structure and use according to the most recent Candidate Recommendation (July 3, 2000).


Every developer is familiar with the linking capabilities of the Web today. However, as the use of XML grows, we quickly realize that simple tags like <A HREF="elem_lessons.html">Freud</A> are not going to be enough for many of our needs.

Table of Contents

An Example XLink
XLink Reference
  •The XLink Type Attribute
  •XLink Types: Use and
  •Simple Links
Tools and References

Consider, for example the problem of creating an XML-based help system similar to ones used in some PC applications. Among other things (such as displaying amusingly animated characters), the system might be capable of performing the following actions when a user clicks on a topic:

  • Opening an explanatory text (with a link back to the main index)
  • Opening a window and simulate the actions to be taken (e.g., going to the "Edit" menu and pressing "Include Image")
  • Opening up a relevant dialog (e.g, a file chooser for the image to include)

Trying to code something like this (links with multiple targets, directions, and roles) in XML while having old "<a href..." in mind is confusing, and leads people to questions like the following:

  • What is the "correct" tag for links in XML?>
  • If there is such a magic element, how can I make it point to more than one resource?
  • What if I want links to have different meanings relevant to my data? E.g., the "motherhood" and "friendship" relationships between two "person" elements

In answer to these and many other linking questions, this article describes the structure and use of XLink. The article is composed of three parts: a brief example that illustrates the basics of the language, a complete review of the structure of XLink, and a list of XLink-related resources. The resources include some XSLT transformations that enable your HTML output to simulate required XLink behavior on today's browsers.

Pages: 1, 2, 3

Next Pagearrow