XML technologies / DocBook / Block elements / Graphics / Graphics outside the text flow (block)

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

For graphics that should appear between paragraphs, for example, use the element mediaobject. It contains one or more imagedata elements, usually containing different formats of the same graphic. One is chosen according to the target format. The example below has two entries, for HTML and FO. The DocBook stylesheets select the appropriate format for the target.

Example: Alternative graphic objects in mediaobject

<mediaobject>
  <imageobject role="html">
    <imagedata fileref="mygraphic.png"/>
  </imageobject>
  <imageobject role="fo">
    <imagedata fileref="mygraphic.pdf"/>
  </imageobject>
</mediaobject>

Line 1: Container for alternative graphic objects
Line 2: PNG graphic for HTML
Lines 3 and 6: Reference the appropriate graphic. This element also permits attributes controlling size and alignment.
Line 5: PDF graphic for XSL-FO

  

back to top