XML technologies / DocBook / Cross-references and links / Internal cross-references / Simple cross-references
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
In most cases, it is sufficient to:
Place an anchor at the location you want to reference.
Enter the internal cross-reference as
<xref/>and make the content of the attributelinkendpoint to the previously defined anchor.
The following example shows how this looks.
Example: A DocBook document with cross-references (xref01.xml)
<chapter ANKER="prod.description">
<title>Produktbeschreibung</title>
<para> ... </para>
</chapter>
...
<para>Weitere Informationen erhalten Sie in <xref linkend="prod.description"/>.</para>Replace the placeholder ANKER with id in DocBook 4 and xml:id in DocBook 5.
After processing, you obtain, for example:
Weitere Informationen erhalten Sie in Kapitel 2, "Produktbeschreibung".
The xref element is replaced by the highlighted text. The DocBook stylesheets generate the replacement text, including the word Kapitel, the chapter number and the quotation marks. Depending on the output format, the highlighted text becomes a link.
Copyright © 2009 Millin Verlag
You may print the online version for your private use.
Otherwise, this chapter from "DocBook-XML: Medienneutrales und plattformunabhängiges Publizieren" is subject to the same provisions as the printed edition: the work, including all its parts, is protected by copyright. All rights are reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
Millin Verlag, Siebengebirgsring 36, 53797 Lohmar, info(at)millin.de
back to top