Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader

Notices

Reply
 
Thread Tools Search this Thread
Old 01-13-2014, 01:31 AM   #31
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 davidfor View Post
I was looking at this yesterday, and I agree with you about the depth. I think that calibre is setting it one higher than it should. Except maybe if the TOC is empty. That one had me as I couldn't find a spec to say what should be in the navmap for that. Or whether it should be there at all.
The TOC isn't allowed to be empty. The spec requires one navMap element, which must contain one or more navPoint elements. Thus, not empty. That's why some software puts that "Start" point into the TOC if nothing's been defined, so the TOC isn't empty. In generating an empty TOC as you describe, Calibre is violating the spec.

Last edited by Rev. Bob; 01-13-2014 at 01:35 AM.
Rev. Bob is offline   Reply With Quote
Old 01-13-2014, 01:34 AM   #32
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
Duplicate post.
Rev. Bob is offline   Reply With Quote
Advert
Old 01-13-2014, 01:42 AM   #33
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: 44,870
Karma: 168802811
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
My read of the spec is that the TOC must contain at least one navPoint element; that is, it cannot be empty. This correlates with the requirement that the depth must be a positive integer; a TOC with only one navPoint element is "flat" by definition and thus has the minimum depth of 1.
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 -- and 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.

* I got this from the Daisy spec where it states that navPoint contains one or more navLabels but does not state that navMap contains one or more navPoints. If it ain't compulsory, it's not required so a <navMap> </navMap> structure would appear to be valid.


Regards,
David

Last edited by DNSB; 01-13-2014 at 02:02 AM. Reason: fat fingers cause typos...
DNSB is offline   Reply With Quote
Old 01-13-2014, 02:02 AM   #34
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Rev. Bob View Post
The TOC isn't allowed to be empty. The spec requires one navMap element, which must contain one or more navPoint elements. Thus, not empty. That's why some software puts that "Start" point into the TOC if nothing's been defined, so the TOC isn't empty. In generating an empty TOC as you describe, Calibre is violating the spec.
Can you point to the statement? From what I can see, the navmap is required, but it doesn't say anything about requiring a navpoint.
davidfor is offline   Reply With Quote
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
Advert
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
a novel way to corrupt your database? paola Kobo Reader 20 07-27-2013 03:18 PM
Database corrupt mwerth1 Calibre 4 08-07-2012 07:31 PM
Corrupt database tonyjbird Introduce Yourself 5 04-03-2012 06:26 AM
Corrupt database jjansen Calibre 4 10-26-2011 11:51 PM
corrupt database, (powercut), possible solution Perkin Calibre 7 09-19-2010 11:01 PM


All times are GMT -4. The time now is 11:22 PM.


MobileRead.com is a privately owned, operated and funded community.