| Previous | Next
Link BehaviorSo far, we've been careful to talk in the abstract. We've said that an XLink describes a connection between two resources, but we haven't said much about how that connection is presented to the end user or what it makes software reading the document do. That's because there isn't one answer to these questions. For instance, when the browser encounters a <image xlink:type="simple" xlink:href="http://web.archive.org/web/www.turing.org.uk/turing/pi1/bus.jpg" /> Here, the author most likely intends the browser to download and display the image as soon as it finds the link. And rather than opening a new window for the image or replacing the current document with the image, the image should be embedded into the current document. Just as XML is more flexible than HTML in the documents it describes, so too is XLink more flexible in the links it describes. An XLink indicates that there's a connection between two documents, but it's up to the application reading the XLink to decide what that connection means. It's not necessarily a blue, underlined phrase on which the user clicks in a browser to jump from the first source document to the target. It may indeed be that, just as an XML document may be a web page, but it may be something else too. Page authors can offer suggestions to browsers about how links should be handled by using the xlink:showThe optional
All five of these are only suggestions that browsers or other applications following XLinks are free to ignore. For example, a web spider would not open a window for any link and might ignore embedded links and treat the other four types identically. Mozilla might open a new tab in an existing window for xlink:actuateThe optional
All four of these are only suggestions that browsers or other applications following XLinks are free to ignore. For example, a web spider would use its own algorithms to decide when to follow and not follow a link. Differing behavior when faced with the same attributes is allowed as long as it makes sense for the application reading the document. For example, a traditional link such as is provided by HTML's <novel xlink:type="simple" xlink:href="ftp://archive.org/pub/etext/etext93/wizoz10.txt" xlink:actuate="onRequest" xlink:show="replace"> <title>The Wonderful Wizard of Oz</title> <author>L. Frank Baum</author> <year>1900</year> </novel> This says to wait for an explicit user request to follow the link (e.g., clicking on the content of the link) and then to replace the existing document with the document found at ftp://archive.org/pub/etext/etext93/wizoz10.txt. On the other hand, if you were using XLinks to embed images in documents, you'd want them traversed immediately and then embedded in the originating document. The following syntax would be appropriate: <image xlink:type="simple" xlink:actuate="onLoad" xlink:show="embed" xlink:href="http://web.archive.org/web/www.turing.org.uk/turing/pi1/bus.jpg" /> Both |