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:

<div class="chapter" LANG="de">

In this case, the div wraps a chapter element from the original document.

<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 div elements are children of div class="book". The same applies to other structural elements. Changing parameters of the XSLT stylesheets may remove some div elements or add others.

<div class="navheader">...</div> 
<div class="Chunkelement">...</div> 
<div class="navfooter">...</div>

<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).

  

back to top