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:

  1. Place an anchor at the location you want to reference.

  2. Enter the internal cross-reference as <xref/> and make the content of the attribute linkend point 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.

  

back to top