XML
  Home arrow XML arrow Page 3 - XLink Basics
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
Moblin 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
IBM developerWorks
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
XML

XLink Basics
By: Vikram Vaswani, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 3
    2001-10-05

    Table of Contents:
  • XLink Basics
  • ...In With The New
  • Playing By The Rules
  • A Little Experiment
  • Back To Base
  • A Little More...

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
    IBM developerWorks
     
    ADVERTISEMENT

    Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!

    XLink Basics - Playing By The Rules


    (Page 3 of 6 )

    Now that you've seen the various XLink types in action, let's focus on the attributes available in the XLink namespace to provide more information on a particular link type or modify its behaviour.

    Every element defining an XLink *must* contain a "type" attribute, which specifies what type of link it is - the value for this attribute may be any one of "simple", "extended", "locator", "arc", "resource", "title" or "none".

    In addition to the "type" attribute, the XLink specification defines nine additional attributes:

    The "href" attribute is used to specify the URL of a remote resource, and is mandatory for locator links. In addition to the URL of the remote resource, it may also contain an additional "fragment identifier", which drills down to a specific location within the target document.

    The "show" attribute is used to define the manner in which the endpoint of a link is presented to the user. The value of this attribute may be any one of "new" (display linked resource in a new window); "replace" (display linked resource in the current window, removing whatever's currently there); "embed" (display linked resource in a specific area of the current window); "other" (display as per other, application-dependent directives); or "none" (display method unspecified)

    The "actuate" attribute is used to specify when a link is traversed - it may take any of the values "onLoad" (display linked resource as soon as loading is complete); "onRequest" (display linked resource only when expressly directed to by the user, either via a click or other input); "other" and "none".

    The "label" attribute is used to identify a link for subsequent use in an arc.

    The "from" and "to" attributes are used to specify the starting and ending points for an arc respectively. Both these attributes use labels to identify the links involved.

    The "role" and "arcrole" attributes reference a URL which contains information on the link's role or purpose. Most often, you can ignore these attribute, as they are intended primarily for descriptive purposes. The only exception to this is when the "arcrole" attribute used in conjunction with a linkbase - more on this later.

    The "title" attribute, not to be confused with the title type of link, provides a human-readable descriptive title for a link.

    It should be noted that it is not necessary for all these attributes to be present in a particular XLink definition. It is certainly mandatory for any element defining an XLink to contain a "type" attribute, but with this obvious exception, different types of links have different attribute requirements.

    Here are the basic rules:

    1. A simple link may contain an "href" attributes to define the remote resource, and optional "show" and "actuate" attributes to define link behaviour; however, none of these are mandatory.

    2. An extended link may contain optional "role" and "title" attributes to define its purpose.

    3. A locator link must contain an "href" attribute to define the URL of the remote resource. It typically also uses an optional "label" attribute to identify itself for arc traversals.

    4. A resource link usually contains an optional "label", again for purposes of arc traversals.

    5. An arc typically contains optional "from" and "to" attributes to define the direction of link traversal, optional "show" and "actuate" attributes to specify how and when to traverse links, and an optional "arcrole" attribute if used in the context of a linkbase.

    More XML Articles
    More By Vikram Vaswani, (c) Melonfire


     

       

    XML ARTICLES

    - 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...
    - Practical XML Data Design and Manipulation f...
    - SimpleXML
    - XForms Basics, Part 3
    - XForms Basics, Part 2
    - XForms Basics





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway