XML technologies / DocBook / Block elements / Annotations / Adding block annotations
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
The element annotation adds extensive annotations to an element. Block annotations may appear anywhere and, unlike inline annotations, can contain almost all DocBook block elements. A simple block annotation has the following structure:
Example: A simple block annotation
<annotation>
<title>XML-Namensraum</title>
<para>...</para>
</annotation>There are two markup methods for attaching a block annotation:
The start tag
<annotation>contains an attributexml:id. The element to be annotated adds the attributeannotates. The value ofannotatespoints to the attributexml:id.The start tag
<annotation>contains an attributeannotates. The element to be annotated needs the attributexml:id.
In method 1, the annotation contains an anchor (see below).
Example: Anchor in the start tag annotation
<annotation xml:id="an_db">
<title>DocBook</title>
<para>DocBook 5, jetzt neu! Zu finden unter <link xlink:href="http://www.docbook.org"/></para>
</annotation>
<!-- ... -->
<para>Für Dokumentationen wird <phrase annotations="an_db">DocBook</phrase> verwendet, das ...</para>In method 2, the target element contains the anchor, and the annotation specifies its target (see below).
Example: Anchor in the target element’s start tag
<annotation annotates="p_db">
<title>DocBook</title>
<para>DocBook 5, jetzt neu! Zu finden unter <link xlink:href="http://www.docbook.org"/></para>
</annotation>
<!-- ... -->
<para>Für Dokumentationen wird <phrase xml:id="p_db">DocBook</phrase> verwendet, das ...</para>Both examples produce the same result. Clicking the image after the word DocBook opens the annotation (see the following figure).
Figure: Open annotation in (X)HTML
An annotation with an anchor can be reused, which distinguishes the methods. Method 1, with an anchored annotation, is usually the most flexible.
Note: Multiple annotations
To attach multiple annotations, add the corresponding anchor values to the attribute annotates. It accepts multiple references separated by spaces:
<phrase annotates="annot_1 annot_2">...</phrase>
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