Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 10-16-2022, 01:54 PM   #1
Simons Mith
Member
Simons Mith began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Oct 2020
Device: none
A curiosity: <ol start="7"> not valid in epub 2.0.1?

I was using epubcheck, and it's validating an epub of mine to version 2.0.1

I'm getting an error as follows:
ERROR(RSC-005): ebook.epub/OPS/xhtml/chapter10.xhtml(234,15): Error while parsing file: attribute "start" not allowed here; expected attribute "class", "dir", "id", "lang", "style", "title" or "xml:lang"

The culprit is an <ol> tag which resumes from an earlier section so needs to start counting from 7. I'd prefer my book to validate correctly, but I wonder if this might be an oversight in the validator. Is epubcheck correct in telling me that 2.0.1 era epubs are not capable of using custom list numbering? None of the various ebook readers I've tried (including Calibre) appear upset by the glitch, and I'm wondering if it even IS an error.

IIRC somewhere on the IDPF pages there was a list of what tags/attributes are permissible in which epub version, but of course I can't find it right now
Simons Mith is offline   Reply With Quote
Old 10-16-2022, 01:57 PM   #2
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,107
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Maybe you can post a snippet of the code for us to look at.
Karellen is offline   Reply With Quote
Advert
Old 10-16-2022, 02:05 PM   #3
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,038
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Simons Mith View Post
I was using epubcheck, and it's validating an epub of mine to version 2.0.1

I'm getting an error as follows:
ERROR(RSC-005): ebook.epub/OPS/xhtml/chapter10.xhtml(234,15): Error while parsing file: attribute "start" not allowed here; expected attribute "class", "dir", "id", "lang", "style", "title" or "xml:lang"

The culprit is an <ol> tag which resumes from an earlier section so needs to start counting from 7. I'd prefer my book to validate correctly, but I wonder if this might be an oversight in the validator. Is epubcheck correct in telling me that 2.0.1 era epubs are not capable of using custom list numbering? None of the various ebook readers I've tried (including Calibre) appear upset by the glitch, and I'm wondering if it even IS an error.

IIRC somewhere on the IDPF pages there was a list of what tags/attributes are permissible in which epub version, but of course I can't find it right now
Yes, that's correct about ePub 2. You can try ePub 3 and see what happens.
JSWolf is online now   Reply With Quote
Old 10-16-2022, 03:42 PM   #4
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,171
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Also don't use automatic numbers of any kind in lists. Just use an un-numbered list and insert desired number/style at the start of each list item. Automatic numbering or bullets or anything other than indented list doesn't work in every ereader or app anyway. The manual approach always works. It's just you have to renumber if you later add an item in the middle.

Auto list numbering, auto section numbering and auto chapter numbering are just a convenience best avoided either in source Wordprocessor or HTML editors.
Quoth is offline   Reply With Quote
Old 10-18-2022, 10:13 AM   #5
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by Karellen View Post
Maybe you can post a snippet of the code for us to look at.
Nah, unneeded if this is ePUB2. Isn't and hasn't been supported since the jump. Can't restart a list (with a starting # other than 1, that is) successfully, to the best of my knowledge.

Hitch
Hitch is offline   Reply With Quote
Advert
Old 10-18-2022, 12:34 PM   #6
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
... meaning it might be supported by some reader, but it's not in the required set for ePub2 (and it's probably illegal in XHTML), so you can't rely on it.
Jellby is offline   Reply With Quote
Old 10-21-2022, 01:13 AM   #7
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Hitch View Post
Nah, unneeded if this is ePUB2. Isn't and hasn't been supported since the jump. Can't restart a list (with a starting # other than 1, that is) successfully, to the best of my knowledge.
Yep, for more detailed discussion on <ol> and why you should avoid it in ebooks, see:

Much better to change this:

Code:
<ol start="7">This is an example.</ol>
and "bake the number" into the paragraph itself:

Code:
<p class="list">7. This is an example.</p>
This will make sure any device will be displaying it correctly.

Sad that that's the reality (because it stinks for Accessibility), but that's the only way to:
  • reliably handle non-starting-from-1 lists.
  • appear the same on all devices.
  • handle complicated numbering + symbol schemes.
    • Like Roman Numerals, Greek Letters, Indic, etc.

Quote:
Originally Posted by Jellby View Post
... meaning it might be supported by some reader, but it's not in the required set for ePub2 (and it's probably illegal in XHTML), so you can't rely on it.


And, in EPUB3 and HTML5+CSS3, you can do a lot more stuff... but again, many devices won't show this, so you have to settle for least common denominator.

If you were making a website though... yes, you could use lots of fancy <ol> + list-style-type + CSS3 Counters code.

But since we're doing ebooks, we most likely have to settle for hardcoded numbers in the text!

Last edited by Tex2002ans; 10-21-2022 at 01:24 AM.
Tex2002ans is offline   Reply With Quote
Old 01-25-2023, 08:19 PM   #8
Simons Mith
Member
Simons Mith began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Oct 2020
Device: none
Well it's the middle of the night, and in this late caffeine fugue I've stumbled a hideous hack that seems to work. Code snippet follows:
Code:
li.hidden {
visibility: hidden;
height: 0 }
and

Code:
<ol>
<li class="hidden">1</li>
<li class="hidden">2</li>
<li class="hidden">3</li>
<li>List item starting at 4, but works in EPUB 2!</li>
<li>Please don't hate me</li>
<li>Obviously if you want to start at 50 or something it sucks to be you</li>
<li>So, yuck</li>
</ol>
Feel free to say ewwww. On text to speech, I'd /hope/ it doesn't read out the hidden values, but I don't know.

This is definitely one of those case where I'm torn between doing it, because I can, and feeling guilty about how horrible it is

Last edited by Simons Mith; 01-25-2023 at 08:26 PM.
Simons Mith is offline   Reply With Quote
Old 01-25-2023, 10:08 PM   #9
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
I stand by everything I said in October 2022. In that case, just hardcode your numbers.
Tex2002ans is offline   Reply With Quote
Old 01-25-2023, 10:25 PM   #10
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,107
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by Simons Mith View Post
Feel free to say ewwww. On text to speech, I'd /hope/ it doesn't read out the hidden values, but I don't know.
Maybe try display:none; speak:none;

display :
Element is removed from the normal flow and hidden; the space it occupied is collapsed

visibility:
Element is hidden from view, but is not removed from the normal flow
Karellen is offline   Reply With Quote
Old 01-26-2023, 05:53 AM   #11
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,171
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Quote:
Originally Posted by Tex2002ans View Post
I stand by everything I said in October 2022. In that case, just hardcode your numbers.
Agree totally.
Quoth is offline   Reply With Quote
Old 01-26-2023, 06:29 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,553
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Tex2002ans View Post
I stand by everything I said in October 2022. In that case, just hardcode your numbers.
Yep. The workarounds are more work than just styling your hard-coded numbers in p tags. And are likely to break under different conditions.

Not to mention that I've never understood how ol elements are all that useful in ebooks to begin with. Unless you're coding a website that generates lists from dynamic database data, your numbered lists are unlikely to ever change. So code them (lists) up once, style them, and be done with them.
DiapDealer is offline   Reply With Quote
Old 01-26-2023, 07:36 AM   #13
Sarmat89
Evangelist
Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.
 
Posts: 482
Karma: 2267928
Join Date: Nov 2015
Device: none
Lists are getting a nice hanging indent which is very hard to reproduce without it.
Sarmat89 is offline   Reply With Quote
Old 01-26-2023, 07:55 AM   #14
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,553
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Yes the hanging indents are very nice. But I'll choose "works everywhere" over "looks pretty" any day of the week.
DiapDealer is offline   Reply With Quote
Old 01-26-2023, 08:09 AM   #15
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,171
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Quote:
Originally Posted by Sarmat89 View Post
Lists are getting a nice hanging indent which is very hard to reproduce without it.
Simple with a suitable CSS
Quoth is offline   Reply With Quote
Reply

Tags
<ol start="">, attribute, epub 2.0.1, tag


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bogus "Not a Valid Picture" Errors johnelle Library Management 9 09-18-2021 11:03 PM
How to define the "Start" or "Beginning" page in Calibre paul_01 Conversion 5 08-12-2016 06:58 AM
epub to mobi problems "No valid entries in the spine of this EPUB" TheFatMan Conversion 1 09-10-2013 10:59 PM
Is "dc:rights" a valid entry in an OPF file for Kindlegen? Stodder Kindle Formats 5 06-06-2011 06:52 PM
"invalid PID checksum" when using mobidedrm, even though it IS valid. Haidon Kindle Formats 141 11-05-2010 12:02 PM


All times are GMT -4. The time now is 07:01 AM.


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