![]() |
#1 |
Enthusiast
![]() Posts: 25
Karma: 10
Join Date: May 2024
Device: Kindle
|
epubcheck Error
Hi all,
I am trying to publish my first book. I wrote it in HTML and converted it to epub using Calibre. On the Google Play Store, I received the following error on about half of my splits and I have no idea how to address them: Error while parsing file: attribute "class" not allowed here; expected attribute "dir", "lang", "version" or "xml:lang" Any thoughts would be greatly appreciated. |
![]() |
![]() |
![]() |
#2 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 75,652
Karma: 134254544
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Enthusiast
![]() Posts: 25
Karma: 10
Join Date: May 2024
Device: Kindle
|
Here is the code for the entire first split:
<?xml version='1.0' encoding='utf-8'?> <html xmlns="http://www.w3.org/1999/xhtml" class="calibre"> <head> <title>Unknown</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link rel="stylesheet" type="text/css" href="stylesheet.css"/> <link rel="stylesheet" type="text/css" href="page_styles.css"/> </head> <body class="calibre1"> <p class="halftitle" id="calibre_toc_1">THE ULTIMATE H.P. LOVECRAFT</p> <div class="calibre2" id="calibre_pb_1"></div> </body></html> |
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,635
Karma: 23190435
Join Date: Dec 2010
Device: Kindle PW2
|
Delete the part marked in red.
<html xmlns="http://www.w3.org/1999/xhtml" class="calibre"> |
![]() |
![]() |
![]() |
#5 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 75,652
Karma: 134254544
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
The following code is correct. Code:
<?xml version='1.0' encoding='utf-8'?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Unknown</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link rel="stylesheet" type="text/css" href="stylesheet.css"/> <link rel="stylesheet" type="text/css" href="page_styles.css"/> </head> <body class="calibre1"> <p class="halftitle" id="calibre_toc_1">THE ULTIMATE H.P. LOVECRAFT</p> <div class="calibre2" id="calibre_pb_1"></div> </body> </html> |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Enthusiast
![]() Posts: 25
Karma: 10
Join Date: May 2024
Device: Kindle
|
Thank you both so much!
|
![]() |
![]() |
![]() |
#7 |
Enthusiast
![]() Posts: 25
Karma: 10
Join Date: May 2024
Device: Kindle
|
OK, so my new issue is the following error:
Error while parsing file: element "a" not allowed here; expected element "address", "blockquote", "del", "div", "dl", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "ins", "noscript", "ns:svg", "ol", "p", "pre", "script", "table" or "ul" (with xmlns:ns="http://www.w3.org/2000/svg") This is in reference to a line that was a location for a link elsewhere in the book. In the HTML code, I used: <a name="TCOOS"> <p class="subtitle">THE COLOUR OUT OF SPACE</P> In calibre, it changed that to: <a id="TCOOS"> <p class="subtitle" id="calibre_toc_16">THE COLOUR OUT OF SPACE</p> <p class="subsubtitle" id="calibre_toc_17"> I assume I can't just take out "a" but I am not sure what to replace it with. Thank you! |
![]() |
![]() |
![]() |
#8 | |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 38,823
Karma: 153006036
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
For ePub 3, a file with the <a name="TCOOS"> by itself checked by epubcheck give a: Code:
FATAL(RSC-016): Fatal Error while parsing file: The element type "a" must be terminated by the matching end-tag "</a>". For ePub 2, a file with the <a name="TCOOS"> by itself checked by epubcheck gives 3 error messages: Code:
ERROR(RSC-005): Error while parsing file: attribute "name" not allowed here; expected attribute "accesskey", "charset", "class", "coords", "dir", "href", "hreflang", "id", "lang", "rel", "rev", "shape", "style", "tabindex", "target", "title", "type" or "xml:lang" ERROR(RSC-005): Error while parsing file: element "a" not allowed here; expected element "address", "blockquote", "del", "div", "dl", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "ins", "noscript", "ns:svg", "ol", "p", "pre", "script", "table" or "ul" (with xmlns:ns="http://www.w3.org/2000/svg") FATAL(RSC-016): Fatal Error while parsing file: The element type "a" must be terminated by the matching end-tag "</a>". Generally, I find converting an ePub3 input file to an output ePub2 file with calibre is a total pain. Setting the EPUB output to output version 3 helps but still not a great experience. |
|
![]() |
![]() |
![]() |
#9 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,278
Karma: 6700678
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
They look like headings. Why not use the correct heading tags?
<h2>THE COLOUR OUT OF SPACE</h2> (or maybe <h3> depending on the books heading hierarchy) and you can do away with all the other tags. |
![]() |
![]() |
![]() |
#10 | |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 38,823
Karma: 153006036
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
I'm not sure what they are doing with the unterminated <a name="..."> though that may be an attempt to use them in the ToC generation. Hard to say without seeing the full ePub. |
|
![]() |
![]() |
![]() |
#11 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: May 2024
Location: India
Device: none
|
Hey hi, review the HTML code to check compliance with EPUB specification. Replace class with permitted attributes like dir, lang, version, or xml:lang as needed. Validate the HTML code against the EPUB standard to resolve the parsing error.
|
![]() |
![]() |
![]() |
#12 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 75,652
Karma: 134254544
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Do you actually need <a id="TCOOS">? If it's an ID in the Toc, dump it. You don't need it Just have the ToC link to the filename without the ID. There is no need for an ID at the top of the HTML file if it's just for an ID for the ToC.
|
![]() |
![]() |
![]() |
#13 |
Enthusiast
![]() Posts: 25
Karma: 10
Join Date: May 2024
Device: Kindle
|
I actually do need it, because I link to it from three different places in the book besides the TOC. So that's how I tell the links where to point. The crazy thing is that the epub actually works correctly (all the links get me to the right place throughout when using my Kindle or Google Books apps), but the error checker still flags it.
|
![]() |
![]() |
![]() |
#14 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,635
Karma: 23190435
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Try this: <p class="subtitle" id="calibre_toc_16"><a id="TCOOS"></a>THE COLOUR OUT OF SPACE</p> |
|
![]() |
![]() |
![]() |
#15 |
Enthusiast
![]() Posts: 25
Karma: 10
Join Date: May 2024
Device: Kindle
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
EpubCheck Error | gstock97 | Editor | 7 | 07-23-2021 08:58 AM |
EPUBCheck error | gsosigil | Sigil | 3 | 03-21-2021 06:24 PM |
Epubcheck misses error | exaltedwombat | Sigil | 12 | 09-24-2019 04:02 PM |
Error epubcheck | Buble | ePub | 43 | 08-15-2014 01:53 AM |
Error on epubcheck | Brazz | ePub | 5 | 09-01-2011 03:17 AM |