XML technologies / DocBook / Block elements / Graphics / Graphics and text alternatives
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
The element mediaobject allows, in addition to imageobject one or more textobject elements containing an image description. A textobject is used when no suitable image is found. There are three methods:
As short text
As long text
As a reference to a text file.
Short text briefly describes the image. In (X)HTML, a text object using phrase generates an alternative description in the attribute alt of img (see the following example).
Example: Short-text object using phrase
<mediaobject>
<!-- ... -->
<textobject>
<phrase>Ein Pinguin</phrase>
</textobject>
<mediaobject>Long text uses para instead of phrase for longer image descriptions. In (X)HTML, a clickable [D] for description appears in the margin. It links to a separate (X)HTML file containing all of textobject (see the following example).
Example: Long-text object using para
<mediaobject>
<!-- ... -->
<textobject>
<para>Pinguine sind ...</para>
<para>Es gibt die folgenden Arten ...</para>
</textobject>
<mediaobject>The third option is a reference inserted with textdata.
Example: Text object as a reference using textdata
<mediaobject>
<!-- ... -->
<textobject>
<textdata fileref="pinguine.txt">
</textobject>
<mediaobject>The drawback of textdata is that resolving the reference requires an extension function in the XSLT processor (see "Extension functions and elements"). If your processor does not support this extension, replace textdata with XInclude:
Example: Text object as a reference using xi:include
<mediaobject xmlns:xi="http://www.w3.org/2001/XInclude">
<!-- ... -->
<textobject>
<xi:include href="pinguine.txt" parse="text">
</textobject>
<mediaobject>Note: XInclude element in DocBook
The element xi:include is unavailable in version 4 and earlier, but can be added to the DocBookDTD (see "Adding XIncludes to DocBook 4.x"). For DocBook 5, a separate file already contains this element (see "XIncludes in DocBook 5"). For more about XIncludes, see "Including content with XIncludes".
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