XML technologies / DocBook / Block elements / Callouts / Bidirectional linking

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

The previous examples linked from the callout list to markers. Links can also run in the opposite direction, from markers to explanations in the list. This requires two anchors and two back-references, as shown below.

Example: Bidirectional links between a marker and callout list

<programlisting language="python"># ...
cmd = ["file", sys.argv[1], "| cut -d',' -f2" ] <co
   ANKER="co.cmd"
   linkend="cl.cmd" />
# ...
</programlisting>
<calloutlist>
  <callout ANKER="cl.cmd" 
           arearefs="co.cmd">
    <para>...</para>
 </callout>
</calloutlist>

Replace the placeholder ANKER with id in DocBook 4 and xml:id in DocBook 5.

Line 3: Sets the marker’s anchor value.
Line 4: References the entry in the callout list.
Line 8: Sets the list entry’s anchor value.
Line 9: References the marker.

Choose a naming scheme to avoid confusing anchors and back-references.

  

back to top