XML technologies / DocBook / Cross-references and links / Linking with XLinks / External XLinks

(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)

Create an external link using XLink in DocBook 5 as follows:

<a href="xlink:href=&quot;http://www.w3.org/1999/xlink&quot;">XLink-Spezifikation</a>

However, you do not have to use link to create an external link. In DocBook 4, linking a cited work’s title to a website required code like the following. DocBook 4’s content model allows two possibilities:

Example: Two ways to create an external link in DocBook 4

<ulink url="http://www.w3.org/1999/xlink"><citetitle>XML Linking Language (XLink)</citetitle></ulink>

<citetitle><ulink url="http://www.w3.org/1999/xlink">XML Linking Language (XLink)</ulink></citetitle>

In DocBook 5, use XLink directly to simplify this code:

Example: External XLink

<citetitle pubwork="webpage" xlink:href="http://www.w3.org/1999/xlink">XML Linking Language (XLink)</citetitle>

XLinks can also point to URNs. For example, the following code identifies this book’s first edition by its ISBN:

Example: XLinks using a URN

<citetitle pubwork="book" xlink:href="urn:isbn:3899900782">DocBook-XML</citetitle>

Note: XLinks only in inline elements, not structural/block elements
At present, XLinks are useful only in inline elements. They are allowed in structural and block elements, but the DocBook stylesheets still ignore them there. To use XLinks in such elements, customize the stylesheets.

  

back to top