Quote:
Originally Posted by DNSB
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...