The xlink:actuate Attribute

The xlink:actuate Attribute

You can use the xlink:actuate attribute to indicate when a link should be traversed. The xlink:actuate attribute has these predefined values:

  • onRequest The link should be traversed only at the user 's request.

  • onLoad The link should be traversed when the document or resource is loaded.

  • other This is a custom preference, as defined by the application.

  • none This indicates no actuation (or indicates that the behavior of the application is not constrained by the markup).

You can also set your own values for xlink:actuate .

The first of the predefined values, "onRequest" , indicates that the user should request the link to be traversed before any action takes place. Typically, the user request takes the form of a mouse click, as in our earlier mockup of a simple link in Internet Explorer, where we can use the "onRequest" value:

 <?xml version="1.0" encoding="UTF-8"?>  <?xml-stylesheet type="text/css" href="xlink_example.css"?> <!DOCTYPE html SYSTEM "xlink_example.dtd"> <DOCUMENT>     <P>          Want to check out  <LINK xml:type = "simple" href="http://www.w3c.org"   xlink:actuate = "onRequest" onClick=   "location.href='http://www.w3c.org'">W3C</LINK>?  </P> </DOCUMENT> 

If you set the value of xlink:actuate to "onLoad" , the link is traversed when the resource containing it is loaded. For example, you might have a link to an image map's image and want to load it as soon as the containing document is loaded. That might look something like this:

 <IMAGE_MAP xmlns:xlink="http://www.w3.org/1999/xlink"      xlink:type="simple"     xlink:href="http://www.starpowder.com/gifs/image_map.gif"     xlink:actuate="onLoad"> </IMAGE_MAP> 

You can also set xlink:actuate to other , which means that when the link is actually actuated is up to the application. (Of course, it's up to the application in any case, even when you specify another value for xlink:actuate .) The last choice, none , means no actuation or indicates that the markup does not constrain the application as far as the xlink:actuate attribute is concerned .

You can also set you own values for xlink:actuate . For example, you might define your own application-specific values, such as onLoadData , onShowImage , or onUnload .

If you want to create valid XML documents, of course, you'll have to declare xlink:actuate , and that might look something like this in a DTD:

 <!ELEMENT ASTRO_NEWS>  <!ATTLIST ASTRO_NEWS     xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink"     xlink:type CDATA #FIXED "simple"     xlink:href CDATA #REQUIRED     xlink:show (new  replace  embed  other  none) #IMPLIED "replace"     xlink:actuate (onRequest  onLoad  other  none) #IMPLIED "onRequest"> 


Real World XML
Real World XML (2nd Edition)
ISBN: 0735712867
EAN: 2147483647
Year: 2005
Pages: 440
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net