Showing posts with label XLink. Show all posts
Showing posts with label XLink. Show all posts

Tuesday, 29 November 2011

XLink


XLink is the XML way of tackling the issue of creating links between documents. It is very similar to it’s HTML counterpart, the <a> tag. But having a dedicated element for handling linking is not in XML’s spirit ( it would impose unnecessary restrictions that would hamper flexibility ), therefore this functionality is implemented in a separate namespace ( xmlns:xlink=http://www.w3.org/1999/xlink ), and attributed to elements with by setting certain properties.

It can be used for the roles fulfilled by <a> in HTML – to enable the user to navigate to a different document; but they’re more versatile, and have a number of attributes that control it’s behaviour.

An XLink can be of two types: simple and extended. The simple XLink has similar similar capabilities to traditional HTML links: they provide a uni-directional connection between two resources.

Example of simple XLink usage:
 1 <?xml version="1.0"?>
 2 <links xmlns:xlink="http://www.w3.org/1999/xlink">
 3
 4     <blog xlink:type="simple"
 5         xlink:href="http://mihairotaru.blogspot.com">Ram's blog</blog>
 6
 7     <blog xlink:type="simple"
 8         xlink:href="http://native-dev.blogspot.com">Second blog</blog>
 9
10 </links>