ncx文件是epub电子书的又一个核心文件,用于制作电子书的目录,其文件的命名通常为toc.ncx。
ncx文件是一个XML文件,该标准由DAISY Consortium发布(参见http://www.daisy.org)。
下列是一个toc.ncx文件的实例,其中红色部分为必需。<navMap>元素列出了目录的名称和链接地址。其子元素<navPoint>支持嵌套。
<?xml version='1.0' encoding='utf-8'?>
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
<head>
<meta content="coay_307750" name="dtb:uid"/>
<meta content="2" name="dtb:depth"/>
<meta content="COAY.COM [http://www.coay.com]" name="dtb:generator"/>
<meta content="0" name="dtb:totalPageCount"/>
<meta content="0" name="dtb:maxPageNumber"/>
</head>
<docTitle>
<text>《再穷也要去旅行》</text>
</docTitle>
<docAuthor>
<text>黄爱琳</text>
</docAuthor>
<navMap>
<navPoint class="chapter" id="article_307750_1" playOrder="1">
<navLabel>
<text>Chapter_1</text>
</navLabel>
<content src="article_307750_1.html"/>
</navPoint>
<navPoint class="chapter" id="article_307750_2" playOrder="2">
<navLabel>
<text>Chapter_2</text>
</navLabel>
<content src="article_307750_2.html"/>
</navPoint>
<navPoint class="chapter" id="article_307750_3" playOrder="3">
<navLabel>
<text>Chapter_3</text>
</navLabel>
<content src="article_307750_3.html"/>
</navPoint>
<navPoint class="chapter" id="article_307750_4" playOrder="4">
<navLabel>
<text>Chapter_4</text>
</navLabel>
<content src="article_307750_4.html"/>
</navPoint>
<navPoint class="chapter" id="article_307750_5" playOrder="5">
<navLabel>
<text>Chapter_5</text>
</navLabel>
<content src="article_307750_5.html"/>
</navPoint>
</navMap>
</ncx>