XML technologies / ePUB / Open Publication Format / The Manifest element / Fallback items

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

Beyond its central inventory function, the manifest section of OPF can define fallback items, emergency references for readers unable to display or output a particular media type.

OPF and, as described later, OPS require every reader to support at least the core media types (Core Media Types). The following are permitted within an OPF Item reference:

MIME media type

Format

File extension

application/xhtml+xml

Content as XHTML 1.1

.html

application/x-dtbncx+xml

NCX file from DTBook

.ncx

application/x-dtbook+xml

Content as DTBook

.xml

image/gif

Raster graphics format

.gif

image/jpeg

Raster graphics format

.jpg

image/png

Raster graphics format

.png

image/svg+xml

XML graphics format for vector graphics

.svg

text/css

CSS 2.0

.css

Table: OPF core media types

OPF does not prohibit other formats, but always requires a displayable emergency alternative.

For example, you might include a PDF file, which is not a core media type. A suitable fallback item could look like this:

 

<manifest>
  <!-- NCX-Datei -->
  <item id="ncx" href="nav.ncx" media-type="application/x-dtbncx+xml"/>
  <!-- CSS-Stylesheet -->
  <item id="css" href="ebook.css" media-type="text/css"/>
  <!-- Liste der Dokumente -->
  <item id="kap01" href="kap01.htm" media-type="application/xhtml+xml"/>
  <item id="kap01anhangpdf" href="kap01anh.pdf" media-type="application/pdf" fallback="kap01anhanghtml"/>   ①
  <item id="kap01anhanghtml" href="kap01anh.htm" media-type="application/xhtml+xml"/>                       ②
  <item id="kap02" href="kap02.htm" media-type="application/xhtml+xml"/>
  <item id="kap03" href="kap03.htm" media-type="application/xhtml+xml"/>
  . . .
</manifest> 

Code example: Fallback item (XHTML instead of PDF)

The example adds a PDF appendix, such as a form, after chapter 1. At ① the PDF file kap01anh.pdf is declared with its media type. The attribute fallback references another item to display as fallback. That item, here XHTML, follows at ②. The fallback-attribute thus uses the fallback item’s id-value.

   

 

 

 

back to top