NCX

From MobileRead
Jump to: navigation, search

NCX is the short name for a Navigation Control file for XML applications. It is part of the specification for digital talking book DTB and is used in ePub documents to define the Table of Contents (TOC).

Contents

[edit] Overview

While only the TOC portion of the NCX is required for ePub support the entire NCX file could be in the ePub document. The portions that are not supported will be ignored.

[edit] TOC

Here is an example of a toc.ncx file from ePub. It shows the use of a multi-level TOC.

<?xml version="1.0"?>
<!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN"
  "http://www.daisy.org/z3986/2005/ncx-2005-1.dtd">

<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
   <head>
       <meta name="dtb:uid" content="RT8513Z9UM0NLKLF8QX9QDJ3E6ZFL2"/>
       <meta name="dtb:depth" content="3"/>
       <meta name="dtb:totalPageCount" content="0"/>
       <meta name="dtb:maxPageNumber" content="0"/>
   </head>
   <docTitle>
       <text>Document Title</text>
   </docTitle>
   <navMap>
       <navPoint id="navPoint-1" playOrder="1">
           <navLabel>
               <text>Section with no subsection</text>
           </navLabel>
           <content src="text/content001.xhtml"/>
       </navPoint>
       <navPoint id="navPoint-2" playOrder="2">
           <navLabel>
               <text>TOC entry name Section title
               </text>
           </navLabel>
           <content src="text/content001.xhtml#heading_id_3"/>
           <navPoint id="navPoint-3" playOrder="3">
               <navLabel>
                   <text>Section entry name.</text>
               </navLabel>
               <content src="text/content002.xhtml"/>
           </navPoint>
           <navPoint id="navPoint-4" playOrder="4">
               <navLabel>
                   <text>Introduction.</text>
               </navLabel>
               <content src="text/content003.xhtml"/>
               <navPoint id="navPoint-5" playOrder="5">
                   <navLabel>
                       <text>Preserving the Text.</text>
                   </navLabel>
                   <content src="text/content003.xhtml#heading_id_217"/>
               </navPoint>
               <navPoint id="navPoint-6" playOrder="6">
                   <navLabel>
                       <text>Lower level chapter title</text>
                   </navLabel>
                   <content src="text/content003.xhtml#heading_id_218"/>
               </navPoint>
               <navPoint id="navPoint-7" playOrder="7">
                   <navLabel>
                       <text>Another lower level title.</text>
                   </navLabel>
                   <content src="text/content003.xhtml#heading_id_219"/>
               </navPoint>
           </navPoint>
       </navPoint>
   </navMap>
</ncx>

[edit] PageList

The PageList can provide 1 for 1 mapping to the actual page numbers in the physical book. Here is an example of the paglist section:

<pageList>
  <navLabel>
    <text>Pages</text>
  </navLabel>
  <pageTarget type="normal" id="pagetarget000006" value="6" playOrder="6">
    <navLabel>
      <text>6</text>
    </navLabel>
    <content src="part0000.html#page-6"/>
  </pageTarget>
  <pageTarget type="normal" id="pagetarget000007" value="7" playOrder="7">
    <navLabel>
      <text>7</text>
    </navLabel>
    <content src="part0000.html#page-7"/>
  </pageTarget>
</pageList>

This mapping is used in DAISY eBooks. KindleGen can use this information to generate the page numbers in APNX files for use by the Kindle 3 Reader. Adobe Digital Editions does not support this page list but has a different method of doing the same thing.

[edit] OPF

An OPF file is a required section for DTBook as it is for ePub

The NCX file can also have some of the same data at the OPF file for DTBook files. It can contain title, author, and other metadata. It can also point to all of the audio files that are used to present this data to a visually impaired person. The NCX serves as the main collection point for the audio files.

For DTBook (but not needed for ePub) a title similar to the entry shown above in the TOC section will be shown for the Document Title and Document Author could also be shown. The author entry can be repeated if there is more than one author.

<docTitle><text>The Book Title</text></docTitle>
<docAuthor><text>The Authors name</text></docAuthor>

A more complicated but more complete form would be:

<docTitle>
    <text>Revised Standards and Guidelines of Service 
    for the Library of Congress Network of Libraries for the 
    Blind and Physically Handicapped 1995</text>
    <audio src="rs_title.mp3" clipBegin="00:00.00" clipEnd="00:09.04"/>
    <img src="rs_title.png" />
 </docTitle>
 <docAuthor>
      <text>Association of Specialized and Cooperative 
      Library Agencies</text>
      <audio src="rs_title.mp3" clipBegin="00:09.50" clipEnd="00:14.70"/>
 </docAuthor>

[edit] For more information

NCX specification as part of the DTB specification.

Personal tools
Namespaces

Variants
Actions
Navigation
MobileRead Networks
Toolbox