XML technologies / DocBook / Generating (X)HTML / Formatting (X)HTML with CSS / Structure of a generated (X)HTML file
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
A file generated by the DocBook stylesheets has characteristic (X)HTML structures enabling CSS:
DocBook block elements are transformed into an HTML
divelement whose additional attributeclasscontains the DocBook block element’s name:
<div class="chapter" LANG="de">In this case, the
divwraps achapterelement from the original document.
For an unchunked (X)HTML file, the order and hierarchy of
divelements are:
<div class="book" LANG="de">
<div class="titlepage"> ... </div>
<div class="toc"> ... </div>
<div class="chapter" LANG="de"> ... </div>
...
</div>The source was a German-language book, as shown by the first line’s attributes. All further
divelements are children ofdiv class="book". The same applies to other structural elements. Changing parameters of the XSLT stylesheets may remove somedivelements or add others.
In a chunk, the chunk element is surrounded by
navheaderandnavfooter:
<div class="navheader">...</div>
<div class="Chunkelement">...</div>
<div class="navfooter">...</div>DocBook inline elements are usually wrapped in
span. The attributeclassidentifies the DocBook element, illustrated here byacronym:
<span class="acronym">DTD</span>A text editor usually suffices to inspect structure, but browser tools can simplify the task:
- Firefox
Firefox provides the DOM Inspector. To open it, choose Tools > DOM Inspector. Selecting an element in the DOM Inspector highlights its structure in the browser.
- Konqueror
In the menu Settings > Configure Extensions... open the Configuration dialog. Under Tools enable DOM Tree View. In the menu Tools > Show DOM Tree open the dialog.
- Opera
Opera includes DragonFly, a developer tool for examining structure, JavaScript, CSS and other (X)HTML properties. Open the menu Tools > Advanced > Developer Tools (Tools > Advanced > Developer Tools in English).
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