XLink Examples

At the time of this writing, Internet Explorer browser has no support for XLink. The Netscape 6.x and Mozilla 1.x browsers support XLink simple links only.

Listings 14.1 and 14.2 show two brief XML documents that each contain a single XLink simple link.

Listing 14.1. Document1.xml: A Document with a Single XLink Simple Link
<?xml version='1.0'?> 
<?xml-stylesheet href="BigText.css" type="text/css" ?> 
<Document1 xmlns:xlink="http://www.w3.org/1999/xlink"> 
<myPrefix:myElement xlink:href="Document2.xml" 
 xlink:type="simple" 
 xmlns:myPrefix="http://www.XMML.com/"> 
Click here to go to Document 2. 
</myPrefix:myElement> 
</Document1> 
Listing 14.2. Document2.xml: A Document with Another Simple Link
					<?xml version='1.0'?> <?xml-stylesheet ...

Get Sams Teach Yourself XML in 10 Minutes now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.