Home arrow XML arrow Page 4 - XLink Basics

A Little Experiment - 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


If you go back a couple of pages and take another look at how simple links work, it should quickly become obvious to you that the function performed by a simple link is in fact a subset of the functions available in all extended links. XLink, however, has wisely chosen to pre-define simple links as a separate type, both to maintain compatibility with existing HTML4 constructs and to provide a simple shortcut for users who don't need extended link functionality.

It's an interesting experiment, though, to use an extended link (together with its associated resource, locator and arc) to recreate the functionality of a simple link, both as a validation of what you've learned thus far and an understanding of the reasoning behind the separation of the two types. Consider the following simple link.

<item xlink:type="simple" xlink:href="bio.xml">Sinatra's biography</item>
This could be recreated as the following extended link:

<item xlink:type="extended" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- name --> <loc xlink:type="resource" xlink:label="local" xlink:title="Frank Sinatra">Frank Sinatra</loc> <!-- bio --> <rem xlink:type="locator" xlink:href="bio.xml" xlink:label="remote" xlink:title="Biography" /> <!-- local to remote arc - from name to biography --> <arc xlink:type="arc" xlink:from="local" xlink:to="remote" xlink:show="replace" xlink:actuate="onRequest" /> </item>
On a related note, it's also important to understand the difference between a simple link and a locator. A simple link both specifies a remote resource and sets up a one-way traversal rule between itself and the remote resource. A locator, on the other hand, simply specifies a remote resource; it does not automatically set up traversal rules between itself and the remote resource, as simple links do, but leaves that function to an arc.

>>> 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: