View Full Version : Epub Check Errors (loads!)


ghostyjack
09-02-2010, 02:34 PM
I've never used an epub check tool before as I tend to visually inspect the end result - If it look fine in ADE, my reader (PRS-600), Ibis Reader and EpubReader (the FF add-on), then it's fine by me.

This time I thought I'd try them on one of my epubs and see how I did.

I used the epub validator tool on threepress.org and sat back and waited for the result.

I was expecting maybe one or two errors as the code looked pretty ok to me, I did not expect what I got! 223 lines of errors!

I've had a look and can't find anything wrong. Most of the errors appear to be the same problem, heres an extact form the errors:

1.ERROR: Complete Collaborative Works of H. P. Lovecraft.epub/OEBPS/Text/aeons_ch01.xhtml(27): text not allowed here
2.ERROR: Complete Collaborative Works of H. P. Lovecraft.epub/OEBPS/Text/aeons_ch01.xhtml(27): unfinished element
3.ERROR: Complete Collaborative Works of H. P. Lovecraft.epub/OEBPS/Text/alonzo_ed.xhtml(20): element "b" from namespace "http://www.w3.org/1999/xhtml" not allowed in this context
4.ERROR: Complete Collaborative Works of H. P. Lovecraft.epub/OEBPS/Text/alonzo_ed.xhtml(20): text not allowed here
5.ERROR: Complete Collaborative Works of H. P. Lovecraft.epub/OEBPS/Text/alonzo_ed.xhtml(20): element "sup" from namespace "http://www.w3.org/1999/xhtml" not allowed in this context
6.ERROR: Complete Collaborative Works of H. P. Lovecraft.epub/OEBPS/Text/alonzo_ed.xhtml(22): text not allowed here
7.ERROR: Complete Collaborative Works of H. P. Lovecraft.epub/OEBPS/Text/battle_text.xhtml(50): text not allowed here

I've attached a text file with all the errors in (beware, it's long!) and the file I ran it on.

If anyone can point out where I've gone wrong on any of the errors I'd be most greatful.

charleski
09-02-2010, 02:54 PM
The contents of blockquote should be block elements NOT text.
http://xhtml.com/en/xhtml/reference/blockquote/

ghostyjack
09-02-2010, 03:19 PM
Ahhh, I get it. I'll need to look at those blockquote elements and set the contents as block elements or replace them with paragraphs with larger margins.

Thanks.

Jellby
09-03-2010, 04:31 AM
Just use paragraphs inside the blockquote:

<p>Blah, blah, blah wrote:</p>

<blockquote>
<p>Dear Sir,</p>
<p>Blah, blah, blah.</p>
<p>Sincerely,</p>
<div class="signature">Myself</div>
</blockquote>

<p class="noindent">and went to bed.</p>

(I would have liked to include the <blockquote> inside the first <p>, and avoid the "noindent" class, but alas, <p> elements cannot contain other block elements :( )

ghostyjack
09-03-2010, 08:01 AM
Thanks Guys.

That's the problem with self learning, it's easy to miss something if what you doing appears to work, you only find out when it's too late.

I'm going to have to look at all my books I've posted here as I suspect they all contain this problem.

charleski
09-03-2010, 08:34 AM
Don't worry, abuse of the blockquote tag is pretty common among lots of people who should know better. There are some mobi books I've converted that needed loads of work to strip out the nested blockquotes because the person who coded them couldn't be bothered to write proper css.