Home arrow XML arrow Page 5 - XLink Basics

Back To Base - XML

If XML is to get anywhere near as popular as HTML is today, it needs to address a pretty basic requirement: the ability to connect different pieces of data together. Luckily, the W3C has a solution...and it's called XLink. Read on for the scoop.

  1. XLink Basics
  2. ...In With The New
  3. Playing By The Rules
  4. A Little Experiment
  5. Back To Base
  6. A Little More...
By: Vikram Vaswani, (c) Melonfire
Rating: starstarstarstarstar / 3
October 05, 2001

print this article


You already know that XLink allows for inbound, outbound or third-party arcs. Most of the time, arcs are outbound - the direction of link traversal is from the local document to a remote resource - and XLink has no trouble identifying the starting point. However, when the starting point of link traversal is remote, XLink has no way of knowing where to find the link information to initiate the process of traversal.

It's precisely to address this kind of situation that the XLink specification allows for "linkbases" or link databases - essentially, well-formed XML documents that contain extended link information.

XLink defines a link to a linkbase by adding the value

to the arc's "arcrole" attribute. When an XLink link processor comes across such an arc definition, it locates the linkbase, loads the links within it and processes them as per its own built-in rules.

Here's an example of a country being linked to a linkbase of states:

<ext xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="extended"> <!-- start from here --> <link xlink:type="resource" xlink:label="country" xlink:title="Country">United States</link> <!-- linkbase containing links to states --> <directory xlink:type="locator" xlink:href="states.xml" xlink:label="states" xlink:title="States within country" /> <!-- special linkbase arc with arcrole attribute --> <arc xlink:type="arc" xlink:from="country" xlink:to="states" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" xlink:show="replace" xlink:actuate="onRequest" /> </ext>
The XLink specification also raises the possibility of "chained" linkbases - one of the links within the linkbase is itself a link to another linkbase, and so on. While the idea is certainly interesting - think of a Yahoo!-type portal, composed entirely of interconnected XML linkbases - it remains to be seen how link authors would utilize this capability.

>>> More XML Articles          >>> More By Vikram Vaswani, (c) Melonfire

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Google Docs and Xpath Data Functions
- Flex Array Collection Sort and Filtering
- The Flex Tree Control
- Flex List Controls
- Working with Flex and Datagrids
- How to Set Up Podcasting and Vodcasting
- Creating an RSS Reader Application
- Building an RSS File
- An Introduction to XUL Part 6
- An Introduction to XUL Part 5
- An Introduction to XUL Part 4
- An Introduction to XUL Part 3
- An Introduction to XUL Part 2
- An Introduction to XUL Part 1
- XML Matters: Practical XML Data Design and M...

Developer Shed Affiliates


Dev Shed Tutorial Topics: