XLinks

As of this writing, the XLink specification is a W3C recommendation, released on June 27, 2001. You can find the most current version of this recommendation at www.w3.org/TR/xlink. You use XLinks to link one document to another. Here's what the W3C says in the W3C working draft:

This specification defines the XML Linking Language (XLink), which allows elements to be inserted into XML documents in order to create and describe links between resources. It uses XML syntax to create structures that can describe links similar to the simple unidirectional hyperlinks of today's HTML, as well as more sophisticated links.

Here's an example to give you an idea of what an XLink looks like. Unlike HTML hyperlinks, any element can be a link in XML. You specify that an element is a link with the attribute xlink:type like this, where I'm creating a simple XLink:

 <MOVIE_REVIEW xmlns:xlink = "http://www.w3.org/1999/xlink"      xlink:type = "simple"     xlink:show = "new"     xlink:href="http://www.starpowdermovies.com/reviews.xml">     Mr. Blandings Builds His Dream House </MOVIE_REVIEW> 

In this case, I'm creating a simple XLink, which is much like an HTML hyperlink, by setting the xlink:type attribute to "simple" . I'm also setting the xlink:show attribute to "new" , which means that XLink-aware software should open the linked-to document in a new window or other display context. In addition, I'm setting the xlink:href attribute to the unifrom resource identifier (URI) of the new document (which can be quite general and need not be in the uniform resource locator [URL] form I've used here).

For the sake of familiarity , I'm starting with a simple XLink because it's much like an HTML link. However, XLinks can become quite involved, as we'll see in this chapter. Besides basic unidirectional links such as the simple link I've created here, you can also create bidirectional links, links between many documents and even document sets, and much moreyou can even store your links in link databases called linkbases .

Some tools that are designed to help in working with XLink are starting to appear. These include the open source XTooX available at www.xlinkit.com:8080/xtoox/index.html.



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