12-03-2014, 02:59 PM | #16 |
Sigil Developer
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Hi,
You keep calling it a "workaround" but I stll think my "For Example" is in fact the correct way to do what you are trying to do. The only rule on how playOrders should be allocated for ePub 2 is for Talking Books and not normal ebooks. The rule on talking books is that if a link points to the same SMIL time reference, then it needs to have the same playOrder. But in the general, non-talking book case, this rule does not apply. And adding "id" attributes to tags is not clunky. It is simply correct practice to refer to a specific point in the file. This is how real page numbers are handled, etc. As for where bugs are reported, you can do that here or of the github site. Again, you are trying to do something different without adding the proper id tags and then claiming it is a "bug", when I can find no explicit spec that agrees with what you claim for epub 2. That is why we are having this discussion. Kevin |
12-05-2014, 01:55 AM | #17 |
Connoisseur
Posts: 75
Karma: 500000
Join Date: Oct 2011
Location: Utah
Device: iPad
|
Then the question remains, why does the validator check for that specific error, but not the easier, more general case that I used to fix the error?
|
12-05-2014, 02:08 AM | #18 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Because programmers usually think like programmers and not like users... If you want to test a program for bugs or missing features, give it to users to test. They will manage to break and find things because they do things programmers would not think about. Usually because they make no sense (at least from their perspective...).
The validator is not the final word of course. It is just checks their interpretation of the specifications. It is actually quite easy to create a books that fails on (almost) all readers/programs but validates fine. |
12-05-2014, 09:56 AM | #19 |
Connoisseur
Posts: 75
Karma: 500000
Join Date: Oct 2011
Location: Utah
Device: iPad
|
In this case, it also works fine in the readers that I've tested. So if it's not explicitly disallowed in the spec, I'm not sure why (even if it's not explicitly mentioned as allowed) it should be considered invalid. It still seems to me like of course it's something that should be allowed.
The programmers making this test in the validator would have to 1. Check to see if any navpoints point to the same target. 2. Check if the navpoints have the same playOrder. That is the only way this specific validation test could have been programmed, that I can see. There is no way they could program that in without anticipating the possibility of a test where only #1 is the case. So, reading the spec, the programmers must have assumed (as I have assumed) that #1 by itself is not an error at all, but works as intended. So I just looked at the source code for the IDPF validation and it has this: Code:
<sch:pattern name="ncx_playOrderMatch2" id="ncx_playOrderMatch2"> <!-- navPoints, navTargets, and pageTargets that have identical playOrder values must point to same target --> <sch:rule context="//*[@playOrder]"> <sch:assert test="count(//*[@playOrder][number(@playOrder)=number(current()/@playOrder)]/ncx:content[@src != current()/ncx:content/@src])=0"> identical playOrder values for navPoint/navTarget/pageTarget that do not refer to same target </sch:assert> </sch:rule> </sch:pattern> <sch:pattern name="ncx_playOrderMatch" id="ncx_playOrderMatch"> <!-- navPoints, navTargets, and pageTargets that point to same target must have identical playOrder values --> <sch:rule context="//*[@playOrder][ncx:content]"> <sch:assert test="count(//*[@playOrder][ncx:content][ncx:content/@src=current()/ncx:content/@src][number(@playOrder)!=number(current()/@playOrder)])=0"> different playOrder values for navPoint/navTarget/pageTarget that refer to same target </sch:assert> </sch:rule> </sch:pattern> Now, that's their interpretation of the spec, but if anything, this proves I'm no more crazy in my interpretation than the validatior programmers. Last edited by Peter Ahlstrom; 12-05-2014 at 10:08 AM. |
12-05-2014, 10:23 AM | #20 |
Sigil Developer
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Hi Peter,
If you can point me to any spec that says that your way is the right way to do things (outside of the Talking Book spec which uses SMIL time references) I would be happy to take a stab and trying to address this. But without a clear spec one way or the other, I really think you should just properly use "id" attributes to do what you want and still make it pass whatever check there is. As for rules in epubcheck*, they are many many times very arbitrary. For example in early versions of epubcheck 3, they decided that in epub3 there can be a DOCTYPE on top of the toc.ncx (if present for fallback) - which according to the spec, the toc.ncx should have been totally ignored - so that made sense. But in more current versions they have decided to mark that as an "error" for some reason claiming that nothing can have a DOCTYPE that references external namespaces and dtds parsing information. Then someone nicely pointed out to them that some valid toc.ncx files are unparse-able without the proper DOCTYPE with dtds, so how could the toc.ncx be used as a fallback for epub2 without a DOCTYPE? So now in epubcheck4 pre-releases that "error" is no longer an "error". The spec for epub3 also clearly states that the old form of the metadata in the opf is allowed to be there (and must be there to specify the cover page properly in most readers) but must be ignored, but then they actually report back errors on what was supposed to be "ignored". If it was valid metadata in epub2 format it should be properly ignored in epub3 if it doesn't fit, and they ignore that as well. You'll find this same pattern again and again. Simply read the epubcheck bug database to see how often this happens and how arbitrary some of these rules really are. So claiming that the epubcheck validator claims it is a bug, can in fact be totally meaningless. That is why I like to read the spec itself. So if you can find a spec online that clearly states how we do things is wrong, I would be happy to look at it. But if not, I think you should simply add the proper id attributes and be done with it. KevinH Last edited by KevinH; 12-05-2014 at 10:47 AM. |
12-05-2014, 11:45 AM | #21 |
Connoisseur
Posts: 75
Karma: 500000
Join Date: Oct 2011
Location: Utah
Device: iPad
|
Since the spec relies on the Talking Book spec, I don't see how we can ignore it.
Section 2.4.2 of the epub 2.0.1 OPF spec spells out all the exceptions to the Talking Book spec definition of the NCX. And there's nothing in that list of exceptions that says two navPoints cannot point to the same target in an epub's NCX. 2.4.2 says that the NCX spec's references to links to SMIL locations should be read as referring to links to XML elements instead. Last edited by Peter Ahlstrom; 12-05-2014 at 12:03 PM. |
12-05-2014, 12:25 PM | #22 | |||
Sigil Developer
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Hi,
I just read that section again, and I disagree with your interpretation. The spec says under exceptions: Quote:
More clearly the spec states: Quote:
Again I feel you are trying to simply "trick" the ncx to always show something that has already been shown (ie. the preamble part) and that doing so without the proper id tags in the right order violates the "linear document reading order" rule completely. And according to the spec, the playOrder's are actually meaningless in the ebook context as long as they follow the "linear document reading order". So by my reading, the only way to legally do this is to have separate id points in proper linear order: 1. top of file 2. body tag with id 3. id in first paragraph tag of the preamble You can call them anything you like but they should appear in that order to keep the linear reading order since the top of file comes first, the body comes second, and the first paragraph of the preamble would come third. To the reader, all 3 locations will show the same text on the screen but are clearly separate locations in the file in the proper linear reading order KevinH Quote:
Last edited by KevinH; 12-05-2014 at 12:40 PM. |
|||
12-05-2014, 01:08 PM | #23 |
Connoisseur
Posts: 75
Karma: 500000
Join Date: Oct 2011
Location: Utah
Device: iPad
|
But I'm never presenting anything out of order. Having two or three references in a row to the exact same location is not violating linear document order. I'm not listing A B C and then saying "for D and E, skip back over C and look at B again"—that would be a violation of linear document reading order.
Regardless, I'm giving up this fight. Since the playOrder is explicitly optional, and since I'm not happy with the other suggestions here, I'll just delete all the playOrder attributes next time. That's easier to do with a regex search than renumbering things manually. I officially withdraw my bug report. If this issue ever comes up for me again in the future, I'll just deal with it myself. |
12-05-2014, 01:56 PM | #24 | |
Sigil Developer
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Hi Peter,
When you call it "Section 1" and Section 1 clearly and logically starts *after* the preamble, and the preamble has its own link and entry in the ncx, how can linking it backwards to show the preamble (possibly twice or even 3 times if people are electronically navigating by ncx), ever be a "linear reading order". As a reader I would be shown the preamble multiple times instead of the selected "Section 1" which might not even be on the first screen depending on the length of the preamble!! I personally would consider that a bug in how the ebook was created. I am happy you found a solution that works for you but I am astonished by your unwillingness to even consider perfectly normal id attributes on tags. If you ever find a clear spec handling this case in epub 2 (or even epub 3 as Sigil is moving toward epub 3), I would be happy to look at this again. Otherwise there are multiple equally valid solutions for you to choose from. Good luck! KevinH Quote:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
TOC attribute validation error | curiousgeorge | ePub | 3 | 04-18-2013 04:07 PM |
PROBLEM TOC VALIDATION ERROR IN SIGIL | Ibn | ePub | 7 | 06-06-2012 03:28 AM |
Epub validation error (toc) | StirlingEditor | Sigil | 4 | 07-22-2011 09:04 PM |
toc.ncx playOrder question | aarcane | ePub | 8 | 05-25-2010 05:00 AM |
NCX playOrder nuisance | erik5000 | ePub | 3 | 12-24-2009 08:08 AM |