For more details, visit W3C XML Linking language (XLink) V1.0 at: http://www.w3.org/TR/xlink/#N854.

XML Base

XML Base allows developers to specify a document’s base URI. Other links within the same document can then specify links relative to this base. These links could then point to applets, style sheets, images and other files. The syntax for XML Base consists of a single XML attribute named xml:base.

A simple example follows for xml:base in a document with Xlink follows.

Example 2-5 An example of extended links using xbase

<?xml version="1.0"?>

<doc xml:base="http://airlines.org/tomorrow/"

xmlns:xlink="http://www.w3.org/1999/xlink">

<head>

<title>Passenger List</title> </head>

<body>

<paragraph>Pick <link xlink:type="simple" xlink:href="passengers.xml">your meal for the flights</link>!!!</paragraph>

<paragraph>Pick your meals for your flight tomoorw !</paragraph> <meallist xml:base="/mealchoices/">

<item>

<link xlink:type="simple" xlink:href="choice1.xml">Choice 1: Beef Vindalooo</link>

</item>

<item>

<link xlink:type="simple" xlink:href="choice22.xml">Choice 2: Chicken Laksa</link>

</item>

<item>

<link xlink:type="simple" xlink:href="choice3.xml">Choice 3: United Airlines Burger</link>

</item>

</meallist>

</body>

</doc>

The URIs resolving to full URIs would be:

￿“Your meal for the flights” resolves to the URI

"http://airlines.org/tomorrow/passengers.xml"

28 The XML Files: Development of XML/XSL Applications Using WebSphere Studio

Page 44
Image 44
IBM Version 5 manual XML Base, Example 2-5 An example of extended links using xbase