XML technologies / ePUB / Open Publication Structure / Structure and organization / Organization in XHTML
(Excerpt from “E-Books mit ePUB ─ Von Word zum E-Book mit XML” by Dr. Victor Wang)
Without semantically required structural elements, XHTML can have a flat structure reduced to headings <h1>, <h2> through <h6>. The earlier code example could be structured as follows:
<h1>Teil III: Weitere Möglichkeiten</h1>
<h2>11. DocBook-Anpassungen</h2>
<h3>11.1 Simplified DocBook</h3>
<p>Text Text Text</p>
<h3>11.2 Andere Anpassungen</h3>
<p>Text Text Text</p>
<h3>11.3 Eigene Anpassungen</h3>
<p>Text Text Text</p> Code example: Flat XHTML structure without div
For meaningful structure, use a <div> block element with an appropriate class attribute:
<div class="Teil">
<h1>Teil III: Weitere Möglichkeiten</h1>
<div class="Abschnitt">
<h2>11. DocBook-Anpassungen</h2>
<div class="Kapitel">
<h3>11.1 Simplified DocBook</h3>
<p>Text Text Text</p>
</div>
<div class="Kapitel">
<h3>11.2 Andere Anpassungen</h3>
<p>Text Text Text</p>
</div>
<div class="Kapitel">
<h3>11.3 Eigene Anpassungen</h3>
<p>Text Text Text</p>
</div>
</div>
</div>
Code example: Proposed XHTML structure with div
XHTML is limited to six levels because only the heading elements <h1> through <h6> are available. Deeper nesting as in DTBook is unavailable in XHTML.
Copyright © mitp 2011
You may print the online version for your private use.
Otherwise, this chapter from “E-Books mit ePUB” is subject to the same terms as the printed edition: the work and all its parts are protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
Verlagsgruppe Hüthig Jehle Rehm GmbH, Im Weiher 10, 69121 Heidelberg, kundenbetreuung(at)hjr-verlag.de
back to top