Thread: Aura HD Corrupt database?
View Single Post
Old 01-11-2014, 06:55 PM   #26
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,864
Karma: 169716272
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Rev. Bob View Post
The specific problem is that Calibre's "depth" value in its NCX files is one point too high. That is, a flat TOC should have a depth of 1, and Calibre assigns 2 instead - and that error propagates no matter how deep the TOC is.

When I contacted the developer about this, complete with reference to the relevant part of the spec, he said that Calibre's behavior is due to the requirement that the depth is at least 1, and a null TOC would generate a value of 0 and thus be out of spec. When I pointed out that a null TOC is also out of spec, he got huffy and put me on his ignore list.

So, now I use Calibre as little as possible and know to always decrement that value when I do so.
Rather interesting since I've found that editing an epub with no TOC entries, generating the TOC gives an entry of dtb:depth=0 which epubcheck and Flightcrew both seem to find no problems with. I guess that since strictly speaking the dtb:xxx tags other than the dtb:id tag, are not part of the epub specification (dtb = Digital Talking Book), that result could be expected.

Checking with the EPUB 2.01 spec gives the following:

"The list of required metadata provided in http://www.niso.org/workrooms/daisy/...5.html#NavMeta does not apply to EPUB; the only required meta is that which contains a content reference to the OPF unique ID. For backwards compatibility reasons, the value of the name of that meta remains dtb:id."

The two sample toc.ncx files below are from the same epub with the <h?> tags in the second changed to <p> tags for the first.

Code:
<?xml version="1.0" encoding="utf-8"?>
<!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="urn:uuid:e721d553-4c20-4d56-8cb2-8ecb1d36900c" />
    <meta name="dtb:depth" content="0" />
    <meta name="dtb:totalPageCount" content="0" />
    <meta name="dtb:maxPageNumber" content="0" />
  </head>
  <docTitle>
    <text>Basic Book</text>
  </docTitle>
  <navMap>
    <navPoint id="navPoint-1" playOrder="1">
      <navLabel>
        <text>Start</text>
      </navLabel>
      <content src="Text/coverpage.xhtml" />
    </navPoint>
  </navMap>
</ncx>
Code:
<?xml version="1.0" encoding="utf-8"?>
<!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="urn:uuid:e721d553-4c20-4d56-8cb2-8ecb1d36900c" />
    <meta name="dtb:depth" content="1" />
    <meta name="dtb:totalPageCount" content="0" />
    <meta name="dtb:maxPageNumber" content="0" />
  </head>
  <docTitle>
    <text>Basic Book</text>
  </docTitle>
  <navMap>
    <navPoint id="navPoint-1" playOrder="1">
      <navLabel>
        <text>Chapter 1</text>
      </navLabel>
      <content src="Text/chapter1.xhtml" />
    </navPoint>
    <navPoint id="navPoint-2" playOrder="2">
      <navLabel>
        <text>Chapter 2</text>
      </navLabel>
      <content src="Text/chapter2.xhtml" />
    </navPoint>
    <navPoint id="navPoint-3" playOrder="3">
      <navLabel>
        <text>Chapter 3</text>
      </navLabel>
      <content src="Text/chapter3.xhtml" />
    </navPoint>
    <navPoint id="navPoint-4" playOrder="4">
      <navLabel>
        <text>Chapter 4</text>
      </navLabel>
      <content src="Text/chapter4.xhtml" />
    </navPoint>
    <navPoint id="navPoint-5" playOrder="5">
      <navLabel>
        <text>Chapter 5</text>
      </navLabel>
      <content src="Text/chapter5.xhtml" />
    </navPoint>
  </navMap>
</ncx>
DNSB is online now   Reply With Quote