Tuesday 28 December 2010

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


What is XLink? XML Linking Language (XLink) is a way of creating a hyperlink in XML. A hyperlink is a reference that a reader can follow to view another Internet page or object. XLink allows you to simulate what HTML does with the tag and create a workable passage inside the document. As with all things XML, there are rules to follow when creating an XLink. Developing a hyperlink with XML requires use of a Uniform Resource Identifier (URI) and namespace to establish the connection. This lets you build a basic hyperlink within your code that can be seen in the output stream. To understand XLink, you must look closer at the syntax in addition In the XML, linking can be either XLink XML Linking Language  or XPointer(XML Pointer).

How to use Xlink :

The XLink specification defines constructs that describe links between objects. XLink became a W3C Recommendation on 27th June 2001. These constructs may be inserted into either XML DTDs or XML document instances. The behavior of these links can resemble that of a simple HTML link, or exhibit more sophisticated behavior. This document also covers using the "xlink:" namespace, explanations of XLink's behavior (show and actuate) and semantic (role and title) attributes, plus basic definitions of simple links, extended links, and extended link groups. The following code below is an example to designate the assertion of XLink in the namespace and inserting an XLink within a XML document.

<?xml version="1.0"?>

<homepages xmlns:xlink="http://www.w3.org/1999/xlink">
<homepage xlink:type="simple"
xlink:href="http://www.w3schools.com">Visit W3Schools</homepage>
<homepage xlink:type="simple"
xlink:href="http://www.w3.org">Visit W3C</homepage>

</homepages>


Extended Hyperlinks

As I have discussed above to get access to the XLink attributes and features you must declare the XLink namespace at the top of the document.

The XLink namespace is: "http://www.w3.org/1999/xlink"
.
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.


Reference:  Use of XLink and XLink Pointer,(2010) [Online] Viewed at: http://xml.coverpages.org/xlinkMaler980402.html [Accessed 23-11-2010]. 

No comments:

Post a Comment