Tuesday, 7 December 2010

XLink

Discuss the notion of Xlink.  What is its purpose and how do you use it? Give example to illustrate your answers.

# Xlink stands for XML Linking Language. It allows elements to be inserted into XML documents in order to create and describe links between resources. It uses XML syntax to create structures that can describe the simple unidirectional hyperlinks of today’s HTML, as well as more sophisticated links. It is an explicit relationship between resources. There are six XLink elements; only two of them are considered linking elements. Whereby, others provide various pieces of information that describe the characteristic of a link. One of the common uses of XLink is to create hyperlinks. Along with providing linking data structures, it also gives a minimal link behaviour model; higher-level applications layered on XLink will often specify alternate or more sophisticated rendering and processing treatments. It has been informed by knowledge of established hypermedia systems and standards. It especially influences the following standards:
  • HTML: defines many element types that represent links.
  • HyTime: defines inline and inbound and third-party link structures and some semantic features, including traversal control and presentation of objects.
  • Text Encoding Initiative Guidelines: gives structure for creating links, aggregate objects and link collections.

In HTML, we know that the <a> element defines a hyperlink. But, this is now how it works with XML. In XML, any names can be given to the element; therefore it is difficult for browser to predict what hyperlink elements will be called in XML documents.
For example:
<?xml version="1.0"?>
<homepages xmlns:xlink="
http://kshitij-palpa.blogspot.com/ ">
<homepage xlink:type="simple"
xlink:href="
http://kshitij-palpa.blogspot.com/ ">Visit blog</homepage>
</homepages>
For access to the XLink attributes and features, XLink namespace must be declare at the top of the document.
The XLink namespace is: "http://kshitij-palpa.blogspot.com/".
The xlink:type and the xlink:href attributes in the <homepage> elements define that the type and href attributes come from the xlink namespace.
The xlink:type="simple" creates a simple, two-ended link (means "click from here to go there"). We will look at multi-ended (multidirectional) links later.

No comments:

Post a Comment