ncx文件是epub电子书的又一个核心文件,用于制作电子书的目录,其文件的命名通常为toc.ncx。
ncx文件是一个XML文件,该标准由DAISY Consortium发布(参见http://www.daisy.org)。
下列是一个toc.ncx文件的实例,其中红色部分为必需。<navMap>元素列出了目录的名称和链接地址。其子元素<navPoint>支持嵌套。
1 <?xml version='1.0' encoding='utf-8'?> 2 <ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1"> 3 <head> 4 <meta content="coay_307750" name="dtb:uid"/> 5 <meta content="2" name="dtb:depth"/> 6 <meta content="COAY.COM [http://www.coay.com]" name="dtb:generator"/> 7 <meta content="0" name="dtb:totalPageCount"/> 8 <meta content="0" name="dtb:maxPageNumber"/> 9 </head> 10 <docTitle> 11 <text>《再穷也要去旅行》</text> 12 </docTitle> 13 <docAuthor> 14 <text>黄爱琳</text> 15 </docAuthor> 16 <navMap> 17 <navPoint class="chapter" id="article_307750_1" playOrder="1"> 18 <navLabel> 19 <text>Chapter_1</text> 20 </navLabel> 21 <content src="article_307750_1.html"/> 22 </navPoint> 23 <navPoint class="chapter" id="article_307750_2" playOrder="2"> 24 <navLabel> 25 <text>Chapter_2</text> 26 </navLabel> 27 <content src="article_307750_2.html"/> 28 </navPoint> 29 <navPoint class="chapter" id="article_307750_3" playOrder="3"> 30 <navLabel> 31 <text>Chapter_3</text> 32 </navLabel> 33 <content src="article_307750_3.html"/> 34 </navPoint> 35 <navPoint class="chapter" id="article_307750_4" playOrder="4"> 36 <navLabel> 37 <text>Chapter_4</text> 38 </navLabel> 39 <content src="article_307750_4.html"/> 40 </navPoint> 41 <navPoint class="chapter" id="article_307750_5" playOrder="5"> 42 <navLabel> 43 <text>Chapter_5</text> 44 </navLabel> 45 <content src="article_307750_5.html"/> 46 </navPoint> 47 </navMap> 48 </ncx>