XML technologies / ePUB / Open Publication Format / Navigation / Page-oriented structures

(Excerpt from “E-Books mit ePUB ─ Von Word zum E-Book mit XML” by Dr. Victor Wang)

NCX supports not only deep content hierarchies but also traditional page navigation. Several scenarios apply: source data may initially derive solely from print production, such as PDFs or scanned book pages. XML data can also record page information alongside content hierarchy for subsequent use.

Such cases use <pageList>, reflecting page structure and sequence. We must emphasize that no known reader currently processes it. The author nevertheless considers it forward-looking and presents it here. Adobe Digital Editions uses a similar but proprietary concept, the page-map.

Wilhelm Busch’s children’s classic Max und Moritz illustrates this. Its rhymed verse and line drawings suit e-readers well. The text is digitally available and out of copyright. Assume Wikisource’s page information from the Wilhelm-Busch-Gesamtausgabe of 1960 is available in XML:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
  <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
     <title>Max und Moritz</title>
  </head>
  <body>
      <h1>Max und Moritz</h1>                                                  ①
     <p class="untertitel">Eine Bubengeschichte in sieben Streichen</p>
     <p class="jahr">(1865)</p>
     <p class="autor">von Wilhelm Busch</p>
      <h2>Vorwort</h2>                                                         ②
      <div class="seite-normal" id="seite0343"/>                               ③
     <p>Ach, was muss man oft von bösen</p>
     <p>Kindern hören oder lesen!!</p>
     <p>Wie zum Beispiel hier von diesen,</p>
     <p>Welche Max und Moritz hießen;</p>
     <div class="block-grafik">
        <img src="img/Max_und_Moritz_001.png" alt="Max und Moritz"/>      
      </div>
     . . .
      <h2>Erster Streich</h2>                                                  ④
      <div class="seite-normal" id="seite0344"/>                               ⑤
     <p>Mancher gibt sich viele Müh'</p>
     . . .
     <p>Und ein stolzer Hahn dabei. -</p>
      <div class="seite-normal" id="seite0345"/>                               ⑤
     <p>Max und Moritz dachten nun:</p>
     . . .
     <p>Tak tak tak! – da kommen sie.</p>
     <div class="block-grafik">
        <img src="img/Max_und_Moritz_006.png" alt="Hühner kommen"/>      
      </div>
      <div class="seite-normal" id="seite0346"/>                               ⑤
     <p>Hahn und Hühner schlucken munter</p>
     . . .
     <p>Reißen sie sich hin und her,</p>
     <div class="block-grafik">
        <img src="img/Max_und_Moritz_009.png" alt="Hühner flattern auf"/>      
     </div>
      <div class="seite-normal" id="seite0347"/>                               ⑤
     <p>Flattern auf und in die Höh',</p>
     . . .
     <p>Und dann kommt der Tod herbei. -</p>
       <div class="seite-normal" id="seite0348"/>                              ⑤
      <div class="block-grafik">
         <img src="img/Max_und_Moritz_012.png" alt="Witwe Bolte hört"/>      
      </div>
     <p>Witwe Bolte in der Kammer,</p>
     . . .
     <p>Hängt an diesem Apfelbaum!!"</p>
      <div class="seite-normal" id="seite0349"/>                               ⑤
     <div class="block-grafik">
        <img src="img/Max_und_Moritz_015.png" alt="Witwe Bolte schneidet ab"/>
     </div>
     <p>Tiefbetrübt und sorgenschwer</p>
     . . .
     <p>Dieses war der erste Streich,</p>
     <p>Doch der zweite folgt sogleich.</p>
      <h2>Zweiter Streich</h2>                                                 ⑥
      <div class="seite-normal" id="seite0350"/>                               ⑦
     . . .
  </body>
</html> 

Code example: Max und Moritz with XHTML page information

Navigation-related structures are shaded gray. First map the content hierarchy, here shortened to preface ② and first prank ④. Page numbers at ③, ⑤ and ⑦, each inside a <div class="seite-normal">, can also support navigation.

The corresponding NCX file would look like this:

<?xml version="1.0" encoding="UTF-8"?>
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1" xml:lang="de" dir="lfr">
  <head>
    <meta name="dtb:uid" content="BestellNr123456"/>
    <meta name="dtb:depth" content="1"/>
    <meta name="dtb:totalPageCount" content="8"/>                             ①
    <meta name="dtb:maxPageNumber" content="350"/>                            ②
  </head>
  <docTitle>
     <text>Max und Moritz</text>
  </docTitle>
  <navMap id="hierarchie">                                                    ③
     <navPoint id="kap0001" playOrder="1">
        <navLabel>
           <text>Vorwort</text>
        </navLabel>
        <content src="kap0001.xml"/>
     </navPoint>
     <navPoint id="kap0002" playOrder="3">
        <navLabel>
           <text>Erster Streich</text>
        </navLabel>
        <content src="kap0002.xml"/>
     </navPoint>
     <navPoint id="kap0003" playOrder="10">
        <navLabel>
           <text>Zweiter Streich</text>
        </navLabel>
        <content src="kap0003.xml"/>
     </navPoint>
  </navMap>
  <pageList id="seiten">                                                      ④
     <navLabel>                                                               ⑤
         <text>Liste der Seiten</text>
     </navLabel>
     <!-- Vorwort (playOrder=1) beginnt auf Seite 343 -->
     <pageTarget id="kap0001s0343" playOrder="2" type="normal" value="343">   ⑥
        <navLabel>
           <text>343</text>                                                   ⑦
        </navLabel>
        <content src="kap0001.xml#seite0343"/>                                ⑧
     </pageTarget>
     <!-- 1. Streich (playOrder=3) beginnt auf Seite 344 -->
     <pageTarget id="seite0344" playOrder="4"type="normal" value="344">
        <navLabel>
           <text>344</text>
        </navLabel>
        <content src="kap0002.xml#seite0344"/>
     </pageTarget>
     <pageTarget id=" seite0345"playOrder="5"type="normal" value="345">
        <navLabel>
           <text>345</text>
          </navLabel>
          <content src="kap0002.xml#seite0345"/>
     </pageTarget>
     . . .
     <pageTarget id="seite0349"playOrder="9"type="normal" value="349">
        <navLabel>
           <text>349</text>
        </navLabel>
        <content src="kap0002.xml#seite0349"/>
     </pageTarget>
     <!-- 2. Streich (playOrder=10) beginnt auf Seite 350 -->
     <pageTarget id="seite0350"playOrder="11"type="normal" value="350">
        <navLabel>
           <text>350</text>
        </navLabel>
        <content src="kap0003.xml#seite0350"/>
     </pageTarget>
    . . .
  </pageList>
</ncx> 

Code example: NCX for Max und Moritz with page information

The first addition is two page metadata values, meaningful when <pageList> exists. The value of dtb:totalPageCount at ① is “8”, eight page entries in total. The highest page number in dtb:maxPageNumber at ② is “350”. Both values are arbitrary, reflecting this highly abridged Max und Moritz example.

The element <pageList> at ④ contains page navigation. The complete <pageList> has its title in a separate <navLabel> element at ⑤.

Each page follows in a <pageTarget> element at ⑥, containing display value ⑦, the page number, and a reference to its content-file location ⑧. The element <pageTarget> should or must use these attributes:

Note on the example’s type assignments:
All elements denoted “ <pageTarget>-” use Arabic pagination, type normal, although title and preface at ③ would normally use Roman numerals. The collected edition prints Busch’s works consecutively, shifting originally Roman pages into the Arabic portion. This concludes the first substandard, OPF.

   

 

 

 

back to top