XLink provides attributes to mark the elements as linking elements. The global attributes which can be used in XLinks are:
Attribute type |
Value |
---|---|
Type definition attribute |
“type”. Specifies type of link. It can be ‘simple’ – suggests it is simple link. ‘extended’ – suggests it is extended link. ‘locator’ – Points to external source. ‘resource’ – Points to internal object. ‘arc’ – the rule defining link between source and destination. ‘title’ – description of the linking element.
|
Locator attribute |
‘href’ – refers to the location link.
|
Semantic Attribute |
‘role’ – It describe the property of the resource. ‘arcrole’ – URI reference for some description of arc role. ‘title’ – Gives description of the
|
Behavior attribute |
show – It specifies where the link has to be opened. It can be ‘new’ i.e. a new window, ‘replace’ i.e. replace existing window, ‘embed’ i.e. embed in the existing window, ‘other’ or ‘none’. The ‘replace’ is the default one. actuate – It refers to, when the linked resource is read. It can be ‘onload’ i.e. when document is loaded or ‘onRequest’ i.e. when link is clicked.
|
Traversal attribute |
‘label’ – It is used to identify the element ‘from’- Defines start point of arc ‘to’ – Defines end point of arc.
|
Simple example with XLink attributes
<?xml version=”1.0”?>
<earth xmlns:xlink=”http://www/w3/org/TR/xlink/”>
<country xlink: type=”simple” xlink:href=”google.com” xlink:show=”new” xlink:actuate=”onRequest”>India</country>
…..
</earth>
Example with multiple XLink attributes
<?xml version=”1.0”?>
<cinema>
<link xmlns:xlink =http://www/w3/ord/TR/xlink/ xlink:type=”extended”>
<film1 xlink:type=”locator” xlink:role=”English” xlink:href=”www.film1promos.xml” />
<hero xlink:type=”locator” xlink:label=”1990” xlink:href=”www.film1promos.xml”>
<award xlink:type=”locator” xlink:label=”multi-starrer” xlink:href=”www.film1promos.xml”>
<bind xlink:type=”arc” xlink:from=”English” xlink:to=”1990”/>
<bind xlink:type=”arc” xlink:from=”English” xlink:to=” multi-starrer”/>
</link>
</cinema>
Comments
No comments have been made yet.
Please login to leave a comment. Login now