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.

   

 

 

 

back to top