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

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 09-20-2017, 05:14 AM   #1
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
navpoint ids and epubcheck

Epubcheck complains if the navpoint ids in the toc.ncx begin with a digit.

e.g:
Code:
<navPoint class="chapter" id="23b2a4fa-6968-47cd-a55b-68ec2650ccde" playOrder="3">
      <navLabel>
        <text>A Reminiscence of Dr Samuel Johnson</text>
      </navLabel>
      <content src="Text/story05.html"/>
</navPoint>
I've looked and can't find any other reference to this id in the ncx, opf or any xhtml file, so I assume they are arbitrary and only need to be unique.

So I just prepended an X to all the ids and it passed epubcheck and seemed OK.

Code:
 id="X23b2a4fa-6968-47cd-a55b-68ec2650ccde"
What are these ids used for anyway?

Last edited by AlanHK; 09-20-2017 at 05:18 AM.
AlanHK is offline   Reply With Quote
Old 09-20-2017, 07:49 AM   #2
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,541
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
The id attribute is required for the navPoint element. And yes, it must he unique. But it also has to conform to xml standards which require that ids do not start with a digit. The one you're dealing with was auto-generated (a urn guaranteed to be unique) by a program when building the toc. Unfortunately, those generated, unique urns sometimes start with number. I honestly don't know that they are "used" per se.

Sigil used to be susceptible to generating invalid ids like that, but that bug was fixed a while back. At least I think it was. At the time, the bugfix was about opf manifest ids rather than toc ids, but I assume the fix was applied to a general id-generating utility function.

Last edited by DiapDealer; 09-20-2017 at 08:03 AM.
DiapDealer is offline   Reply With Quote
Advert
Old 09-20-2017, 08:17 AM   #3
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,606
Karma: 5433388
Join Date: Nov 2009
Device: many
I think the routine we touched only dealt with manifest ids. We should at least look how the toc ids and nav ids are generated to verify they have the same fix.
KevinH is offline   Reply With Quote
Old 09-20-2017, 10:44 AM   #4
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,606
Karma: 5433388
Join Date: Nov 2009
Device: many
Okay I checked src/Exporters/NCXWriter.cpp

and we use:

m_Writer->writeAttribute("id", QString("navPoint-%1").arg(play_order));

So guaranteed to not begin with a digit.

We do similar things in python3lib/ncxgenerator.py so our auto conversion routines from nav to ncx should be fine there.

I also checked the nav for epub3: src/ResourceObjects/NavProcessor.cpp
and it does not use "id" in a similar manner so we are okay there as well.

I did see lots of calls to Gumbo's get_local_text_of_node() and there are no calls to simplified so we should probably add some simplify calls to the NavProcessor.cpp every time we use get_local_text_of_node just to be safe. That said a newline in an html document will just become a space and multiple spaces are condensed in html, so for the nav this may not matter too much.

Last edited by KevinH; 09-20-2017 at 10:46 AM.
KevinH is offline   Reply With Quote
Old 09-20-2017, 10:52 AM   #5
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,541
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I think the .simplified() additions I just pushed the other day (in Headings.cpp) are pretty central to all toc/nav production, but more wouldn't really hurt anything either.

Thanks for looking at the id generation. I didn't think uids were being introduced in the ncx that way, but I couldn't remember for sure.

Last edited by DiapDealer; 09-20-2017 at 10:57 AM.
DiapDealer is offline   Reply With Quote
Advert
Old 09-20-2017, 12:03 PM   #6
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Since you're looking at the NCX code, according to the epub 2.0.1. specs:

Quote:
The NCX file must be a valid XML document conforming to ncx-2005-1.dtd, with the exception of the playOrder attribute, which is optional in EPUB NCX
and

Quote:
Any NCX that contains a DOCTYPE that references the canonical NCX DTD must honor that DTD, thus including the playOrder attribute in all locations where it is required. NCX documents that do not contain a DOCTYPE may omit the playOrder attribute.
[Emphasis mine]

I.e., if you didn't include the ncx-2005-1.dtd DOCTYPE declaration, you could also remove the playOrder attributes, which should theoretically simplify NCX updates.
Doitsu is offline   Reply With Quote
Old 09-20-2017, 12:08 PM   #7
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,606
Karma: 5433388
Join Date: Nov 2009
Device: many
@Doitsu
We actually use the playorder to generate the ids from. To change that now would be more work for no increase in validity.
KevinH is offline   Reply With Quote
Old 09-20-2017, 12:49 PM   #8
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
I know that Sigil doesn't make such ids in an epub it creates, but this was one I cannibalised; no idea what made it to begin with.

Anyway, wanted to confirm that nothing actually refers to this id, so I won't break anything if I change them as I did to shut epubcheck up.

Last edited by AlanHK; 09-21-2017 at 12:16 AM.
AlanHK is offline   Reply With Quote
Old 09-20-2017, 12:57 PM   #9
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,541
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by AlanHK View Post
Anyway, wanted to confirm that nothing actually refers to this id, so I won't break anything if I change them as I did to shut epubcheck up.
No. As long as they're unique (and valid), no harm done. They can be anything. I've never even run into an issue with one that began with a digit on any reader (in any app), to tell the honest truth. But it's best to please Epubcheck when you can. I guess.
DiapDealer is offline   Reply With Quote
Old 09-21-2017, 12:21 AM   #10
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by DiapDealer View Post
But it's best to please Epubcheck when you can. I guess.
When it's giving me dozens of errors like this, I might miss the "real" errors that do have impact. (I wish there was a way to tell it to ignore specific errors.)

And while this one is just a personal project, if you are doing it for a client, passing Epubcheck may be a requirement.
AlanHK is offline   Reply With Quote
Old 09-25-2017, 07:39 AM   #11
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
I've run into this issue before with the unique book id starting with a digit in the opf manifest that Kevin or DiapDealer fixed some while ago. I was the one who reported this problem way back when. What disappoints me is that when I just tested this current problem, Epupcheck still gives this weird error message for wrong ids in the toc.ncx:

Col: 72: ERROR(RSC-005): Error while parsing file 'value of attribute "id" is invalid; must be an XML name without colons'.

This error message would be highly confusing for any indie guy trying to get his book to pass Epubcheck. That error message tells you nothing whatsover about the problem and is highly misleading.

Just a suggestion, but would it be possible to implement a simple change in Sigil where, on opening any epub in Sigil, an automatic check of all the unique ids in the toc.ncx(with a helpful error message for the user if an id incorrectly starts with a digit)? Or another alternative would be to just update the Mend XHTML Source... feature to actually repair this problem automatically if it is found. I also realize that this problem has nothing to do with Sigil -- I'm only suggesting a solution that would perhaps help other Sigil users with this problem in the future.

Last edited by slowsmile; 09-25-2017 at 07:44 AM.
slowsmile is offline   Reply With Quote
Old 09-25-2017, 08:14 AM   #12
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,541
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
No, we're not going to repair invalid ids automatically, and Sigil is no longer in the epub validation game itself. Validation is done by plugins. If you consider Epubcheck's error message to be unhelpful, you should consider reporting this to the Epubcheck developers.

Sigil's validation plugin framework offers plugin developers a way to create their own error-checking routines that go above and beyond what EpubCheck looks for (or how it describes a problem). Perhaps you can convince one to compile a list of extra checks/warnings into plugin that might be more helpful to neophytes.
DiapDealer is offline   Reply With Quote
Old 09-25-2017, 08:28 AM   #13
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by slowsmile View Post
Just a suggestion, but would it be possible to implement a simple change in Sigil where, on opening any epub in Sigil, an automatic check of all the unique ids in the toc.ncx(with a helpful error message for the user if an id incorrectly starts with a digit)?
BTW, Calibre Editor has a built-in repair feature that'll automatically fix, among other things, ncx ids that start with a numeral.
Since you can use both Calibre Editor and Sigil, there's no point in adding this feature to Sigil.
Doitsu is offline   Reply With Quote
Old 09-25-2017, 07:18 PM   #14
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
I've just reported the Epubcheck uuid error message problem on the IDPF Epubcheck issues list on Git Hub(Issue #795).

@Doitsu...Thanks for your info, which was quite useful to know.

Last edited by slowsmile; 09-25-2017 at 11:58 PM.
slowsmile is offline   Reply With Quote
Old 09-26-2017, 12:32 AM   #15
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by slowsmile View Post
This error message would be highly confusing for any indie guy trying to get his book to pass Epubcheck. That error message tells you nothing whatsover about the problem and is highly misleading.
The only way I worked out what the real problem was was by Googling the error message and finding comments that told you.

Also found this discussion on GitHub

https://github.com/IDPF/epubcheck/is...ment-151267599
Quote:
rdeltour commented on 27 Oct 2015

Right, "XML name without colons" comes from the value of the id attribute being required to match the NCName production as required in the Namespaces in XML 1.0 spec.

This error message comes from Jing (the 3d party RelaxNG + Schematron validation engine used by EpubCheck) and as far as I remember we cannot easily override it to make it more user friendly.

See also #193, #224, #307, #533.

I'm closing as wontfix, since we do not have control over the message.
So we will continue to get this confusing and misleading error message indefinitely. Despite it not actually causing any problems except with epubcheck.


Quote:
Originally Posted by slowsmile View Post
I've just reported the Epubcheck uuid error message problem on the IDPF Epubcheck issues list on Git Hub(Issue #795).
As above, this has been reported there at least 5 times already, but it's a "wontfix".

Last edited by AlanHK; 09-26-2017 at 12:53 AM.
AlanHK is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
navPoint ID bookwurm70 Editor 5 06-02-2014 11:39 PM
Wohin gehört NavPoint „Anfang“? praetor Lounge 3 11-09-2012 03:25 PM
Web-based epubcheck upgraded to epubcheck 1.0.5 kjk ePub 4 02-09-2010 09:53 PM
Nested navPoint problem Lemming Calibre 3 12-20-2009 11:24 AM


All times are GMT -4. The time now is 06:37 PM.


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