Skip to Content
XML Hacks
book

XML Hacks

by Michael Fitzgerald
July 2004
Intermediate to advanced
479 pages
12h 30m
English
O'Reilly Media, Inc.
Content preview from XML Hacks

Explore XLink and XML

XLink and XML Base are implemented or partially implemented by Mozilla. This hack explores these technologies, using Mozilla as a platform.

The XML Linking Language or XLink (http://www.w3.org/TR/xlink/) defines a vocabulary for creating hyperlinks to resources using XML syntax. XLink goes beyond the simple linking in HTML and XHTML by adding concrete semantics and extended links that can link to more than one resource. XLink hasn’t really taken off yet, but Mozilla supports simple links in XLink, though not extended links (http://www.mozilla.org/newlayout/xml/#linking). Use of XLink is growing, if slowly—see, for example, the use of XLink in the OpenOffice specification (http://www.oasis-open.org/committees/download.php/6037/office-spec-1.0-cd-1.pdf).

XML Base (http://www.w3.org/TR/xmlbase/) consists of a single XML attribute, xml:base, that acts like the base element from HTML and XHTML; i.e., it explicitly sets the base URI for a document. A base URI is often understood implicitly by a program such as a Web browser by the location of a resource, such as a location on the web or the location of a file in a directory or file structure. In HTML or XHTML, this base URI could be set directly with the base element, as shown in this fragment of XHTML markup (note bold):

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
 <title>Links</title>
 <base href="http://www.xml.com"/>
</head>
<body>
 ...

You set a base URI explicitly using xml:base, as shown in ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

.NET & XML

.NET & XML

Niel M. Bornstein
XML Pocket Reference, 3rd Edition

XML Pocket Reference, 3rd Edition

Simon St. Laurent, Michael Fitzgerald

Publisher Resources

ISBN: 0596007116Supplemental ContentErrata Page