Thread: Aura HD Corrupt database?
View Single Post
Old 01-13-2014, 02:10 AM   #35
Rev. Bob
Wizard
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
Quote:
Originally Posted by DNSB View Post
Minor disagreement. The .ncx file is required to contain a navMap element. I could find no requirement for navPoint or navLabel elements within the navMap(*). The issue seems to arise if there are no TOC elements -- they are not an absolute requirement. Several programs I've used with epubs will add a default navPoint/navLabel pointing to the first file but the depth will remain at 0.
From the Daisy spec, section 8.3, chopped to highlight the relevant declarations:

Quote:
<ncx>
Declaration: <!ELEMENT ncx (head, docTitle, docAuthor*, navMap, pageList?, navList*)>

<navMap>
Declaration: <!ELEMENT navMap (navInfo*, navLabel*, navPoint+)>
To translate that, "*" means "0 or more," "+" means "1 or more," "?" means "0 or 1," and no mark means "exactly 1." Thus, <ncx> must contain one <head>, one <docTitle>, and one <navMap>. It may also contain any number of <docAuthor> and/or <navList> elements, as well as one optional <pageList>.

Moving on to <navMap>, note the "navPoint+" declaration - meaning that one <navPoint> is required, but there can be more. Hence, the spec explicitly forbids an empty TOC.

ETA: It's also worth knowing that the comma-separated element lists dictate that those elements must appear in that order. That is, if you want to specify <docAuthor> elements, they must all appear directly after the <docTitle>, and cannot appear elsewhere in the NCX file. That's not precisely relevant to the issue at hand, but while we're on the subject of DTD syntax anyway...

Last edited by Rev. Bob; 01-13-2014 at 02:31 AM.
Rev. Bob is offline   Reply With Quote