View Full Version : ePub errors (attribute-type, element, text-not-allowed


thiefwriter
09-15-2011, 10:23 PM
My eBook looks great in ePub and Mobi tests, but ePubCheck and ThreePress gave me lots of errors. Taco HTML Edit shows no syntax errors, and examining the unzipped files, I couldn't see anything wrong with the element "i". Any ideas? Thank you in advance!

ERROR: Travel Advisory_ How to Avoid Thefts, Cons, and Street Scams - Bambi Vincent & Bob Arno.epub/TravAd_split_017.html(9): attribute "type" not allowed here; expected attribute "class", "dir", "id", "style", "title" or "xml:lang"

ERROR: Travel Advisory_ How to Avoid Thefts, Cons, and Street Scams - Bambi Vincent & Bob Arno.epub/TravAd_split_017.html(9): element "p" not allowed here; expected element "li"

ERROR: Travel Advisory_ How to Avoid Thefts, Cons, and Street Scams - Bambi Vincent & Bob Arno.epub/TravAd_split_018.html(28): text not allowed here; expected the element end-tag or 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")

ERROR: Travel Advisory_ How to Avoid Thefts, Cons, and Street Scams - Bambi Vincent & Bob Arno.epub/TravAd_split_018.html(28): element "i" not allowed here; expected the element end-tag or 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")

ERROR: Travel Advisory_ How to Avoid Thefts, Cons, and Street Scams - Bambi Vincent & Bob Arno.epub/TravAd_split_018.html(29): text not allowed here; expected the element end-tag or 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")

Jim Lester
09-15-2011, 11:07 PM
what's in TravAd_split_017.html (about line 9 ), and TravAd_split_018.html (around lines 28 and 29)

thiefwriter
09-16-2011, 12:03 AM
Hi Jim,

Inside split 17 of the epub unzipped file is:

<ul type="square" class="calibre13"><p class="calibre3">
</p><li class="calibre14"><b class="calibre16">

but in my html file, before calibre got it, is this:

<ul style="square">
<li>

and in split 18 of the epub unzipped:

</p>
In late 2011, National Geographic aired the documentary <i class="calibre5">Pickpocket King</i> about the couple’s work as “thiefhunters in paradise.” The paradise…

while my original html file (before calibre) is:

In late 2011, National Geographic aired the documentary <i>Pickpocket King</i> about the couple&rsquo;s work as &ldquo;thiefhunters in paradise.&rdquo;

Calibre sure seems to have changed a lot of code. It also took away all the code for quotes, ellipsis, etc.

Jim Lester
09-16-2011, 01:43 AM
First ePub requires XHTML, not HTML, and XHTML is stricter about what goes where.

For the first one, 'p' is not a valid child element of ul, only li is (for XHTML, that is). It looks like Calibre is inserting a p element to take care of whitespace, which it would've been better to ignore (but that's just a guess). I would think about submitting a bug to Koval (depending upon the original source)

For the second one text is not allowed outside of enclosing block element such as 'p' or 'div', from the closing 'p' tag in the original that you show, this is most likely a problem in your original content.

Running your original content through a XHTML validator may help.

thiefwriter
09-16-2011, 02:13 AM
Thank you Jim. You've given me a lot to go on. I'll work on it Friday and report back—I hope with success instead of more questions.

thiefwriter
09-17-2011, 12:02 PM
Jim, you were absolutely right about the blank line. Once I removed them (and changed ids to classes), I got an error-free epub. Thanks so much for the help.