Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 01-04-2011, 03:11 PM   #1
jmatthew
Junior Member
jmatthew began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2011
Device: kindle, sony reader, kobo
Epub works fine on Reader, fails epubcheck spectacularly

Hi,

Complete noob here, but hoping someone can point me in the right direction, since my web searches haven't been fruitful.

My book is out in print, and I managed to create a kindle version, which has been available in the Kindle store for a good year (it's a choose-your-own-adventure, so requires page links and chapter breaks on almost every page)

I recently used Calibre to convert the kindle prc into an epub, and the result reads beautifully on my Sony Reader. However, it fails epubcheck SPECTACULARLY with 694 errors (the Nook bookstore seems to have no problem with this, but to get it in the iBook store it needs to pass).

The vast majority of the errors are:

element "a" from namespace "http://www.w3.org/1999/xhtml" not allowed in this context

(Although sometimes it's a p element or a div element). The docs read fine in a browser, so my html can't be all that messed up.

Any ideas? Thanks in advance for any advice!

Matt

Last edited by jmatthew; 01-04-2011 at 03:15 PM.
jmatthew is offline   Reply With Quote
Old 01-04-2011, 03:24 PM   #2
KevinH
Guru
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 954
Karma: 410248
Join Date: Nov 2009
Device: many
Hi,

My guess (without being able to see the actual file) is that you have anchor tags < a > that exist inside the < body > tag but that are not inside any other < div > or <p > tags.

The xhtml spec basically says that inline tags can not be directly inside the body tag and should instead be inside a block tag of some sort (i.e p or div) tag.

Any easy way to fix this is to run tidy and set the command switches for strict xhtml and to have it wrap these tags with either a div or a p.

My guess for what it is worth.
KevinH is offline   Reply With Quote
Old 01-05-2011, 05:42 AM   #3
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 3,014
Karma: 3618999
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
Run it through Flightcrew. That one gives more sensible error messages and is much better in the checks.
It should give better clues and help you solve the problems. Use Sigil to solve things, this will make life easier...
Toxaris is offline   Reply With Quote
Old 01-05-2011, 06:03 AM   #4
DMSmillie
Enquiring Mind
DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'
 
DMSmillie's Avatar
 
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
Browsers will often handle and display documents which contain HTML that doesn't comply with the HTML specifications, so not always an accurate indication of how compliant the HTML is, I'm afraid. And in order to pass epubcheck, the HTML in an EPUB file has to be spec compliant.

The nature of the book, with lots of links to the different "story choices" throughout the book, makes me suspect that a lot of the errors might relate to the use of empty A elements as bookmarks which aren't contained within a block level element (such as a heading, or paragraph, or div). For example:

Code:
<a name="section001"></a>
<p>Text here.</p>
If this is how your bookmarks are constructed, you can get rid of a lot of the errors by moving the bookmark name to the heading or paragraph immediately following the empty A element and getting rid of the A element (also, if you're currently using the "name" attribute, change that to an "id" attribute instead). For example:

Code:
<p id="section001">Text here.</p>
Existing links to that bookmark will still work fine.
DMSmillie is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre epub works fine on Reader, fails epubcheck spectacularly jmatthew Calibre 2 01-04-2011 03:12 PM
Calibre epub from recipe fails in Sigil and FBReader on Android siebert Calibre 15 12-04-2010 11:18 AM
epub date error fails epubcheck 1.05 dkata Calibre 2 09-13-2010 04:21 AM
To MOBI, Chapter detection fails? Works for EPUB Fmstrat Calibre 7 08-29-2010 05:37 PM
Calibre comic conversion yields poor results when target is epub; looks fine on LRF acidzebra Calibre 2 08-17-2009 10:54 AM


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


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