05-19-2024, 01:25 PM | #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. |
05-19-2024, 01:38 PM | #2 | |
Resident Curmudgeon
Posts: 76,001
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
Advert | |
|
05-19-2024, 01:46 PM | #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> |
05-19-2024, 01:58 PM | #4 |
Grand Sorcerer
Posts: 5,636
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
Delete the part marked in red.
<html xmlns="http://www.w3.org/1999/xhtml" class="calibre"> |
05-19-2024, 02:00 PM | #5 | |
Resident Curmudgeon
Posts: 76,001
Karma: 134368292
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 | |
|
05-19-2024, 02:20 PM | #6 |
Enthusiast
Posts: 25
Karma: 10
Join Date: May 2024
Device: Kindle
|
Thank you both so much!
|
05-19-2024, 11:54 PM | #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! |
05-20-2024, 12:52 AM | #8 | |
Bibliophagist
Posts: 39,715
Karma: 154147706
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. |
|
05-20-2024, 01:16 AM | #9 |
Wizard
Posts: 1,324
Karma: 6700864
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. |
05-20-2024, 02:37 AM | #10 | |
Bibliophagist
Posts: 39,715
Karma: 154147706
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. |
|
05-20-2024, 11:25 AM | #11 |
Resident Curmudgeon
Posts: 76,001
Karma: 134368292
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.
|
05-20-2024, 11:43 AM | #12 |
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.
|
05-20-2024, 12:00 PM | #13 | |
Grand Sorcerer
Posts: 5,636
Karma: 23191067
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> |
|
05-20-2024, 02:00 PM | #14 |
Enthusiast
Posts: 25
Karma: 10
Join Date: May 2024
Device: Kindle
|
|
05-20-2024, 02:11 PM | #15 |
Enthusiast
Posts: 25
Karma: 10
Join Date: May 2024
Device: Kindle
|
My next struggle is line breaks or emphasis within block quotes. Here are two examples:
Error: 28, 79: Error while parsing file: text 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") 28, 100: Error while parsing file: element "br" 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") Here is the code: <blockquote class="calibre8">Come hither, my lads, with your tankards of ale,<br class="calibre4"/> Error: 26, 94: Error while parsing file: text 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") 26, 114: Error while parsing file: element "em" 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") Here is the code: <blockquote class="calibre8">“—the vastness, profundity, and unsearchableness of His works, <em class="calibre6">which have a depth in them greater than the well of Democritus.</em>”</blockquote> Thank you all again! |
|
Similar Threads | ||||
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 |