Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 05-17-2012, 02:55 AM   #1
Stodder
Connoisseur
Stodder began at the beginning.
 
Posts: 75
Karma: 12
Join Date: Apr 2011
Device: ipad, kindle
Epubcheck error -- Epubs and the "a id" tag

Hi guys,

Does anyone know why the following markup in my input hmtl:
Code:
<a id="chapter3" style="page-break-before:always;"></a>
<h2>CHAPTER 3: The Villain Appears Here</h2>
Gives me the following error in epubcheck:

Code:
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/2
000/svg")
The reason why I use the "a id" is because I have a handcoded TOC in the beginning of the html (my entire document is just one huge html that is later cut up by calibre) and the "a id" provides the anchors for my links in the TOC.

My TOC which is near the beginnign of my html:

Code:
<a id="TOC" style="page-break-before:always;"></a>
<h3>Table Of Contents</h3>
<p><br></p>
<p class="toc1">1 <a href="#chapter1">The Beginning Of The Story</a></p>
<p class="toc1">2 <a href="#chapter2">A Young Hero Given A Quest By Some Old Dude</a></p>
<p class="toc1">4 <a href="#chapter3">The Villain Appears Here</a></p>

Any help would be great
Stodder

Last edited by Stodder; 05-17-2012 at 02:58 AM.
Stodder is offline   Reply With Quote
Old 05-17-2012, 02:59 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,317
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You cannot have <a> as a child of <body>. Instead put the id on the <h2> tag
kovidgoyal is offline   Reply With Quote
Advert
Old 05-17-2012, 03:09 AM   #3
Stodder
Connoisseur
Stodder began at the beginning.
 
Posts: 75
Karma: 12
Join Date: Apr 2011
Device: ipad, kindle
Ahh, that's a great idea!
I always thought h tags with id tags were semantically incorrect.

Off to try that ! Hope it works

I know this is the calibre forum, not the kindle one, but could I ask whether doing the whole <a id=""> thing is also a bad idea in MOBI formats? I do it all the time and have never thought that it was a road to errors? Now I'm second guessing my html work that I've done for mobi formats
Stodder is offline   Reply With Quote
Old 05-17-2012, 03:10 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,317
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
it doesn't matter in either mobi or epub. The only people it matters to are the guys that write epubcheck.
kovidgoyal is offline   Reply With Quote
Old 05-17-2012, 03:14 AM   #5
Stodder
Connoisseur
Stodder began at the beginning.
 
Posts: 75
Karma: 12
Join Date: Apr 2011
Device: ipad, kindle
Ah, well that's good to know. I guess the whole error in the first place is not really a big deal then?

But I might just do the h2 tag with id just to avoid epubcheck errors, because some retailers run epubcheck on files, right?
Stodder is offline   Reply With Quote
Advert
Old 05-17-2012, 03:18 AM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,317
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
yes, putting the id on h2 is the correct way to do it.
kovidgoyal is offline   Reply With Quote
Old 05-17-2012, 03:23 AM   #7
Stodder
Connoisseur
Stodder began at the beginning.
 
Posts: 75
Karma: 12
Join Date: Apr 2011
Device: ipad, kindle
Well thanks for that, Kovid!

Off to tidy my work!
Stodder is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
"ELF binary type "0" not known" Error. When run Kindlegen chovan Amazon Kindle 4 02-09-2012 11:49 AM
epubcheck: attribute "page-map" not allowed here error message Doitsu ePub 5 10-27-2011 08:51 PM
Touch "Updating Reading Life" = "Network error" m_bisson Kobo Reader 5 07-15-2011 01:05 AM
attribute "scheme" from namespace error in epubcheck 1.0.5 thunderune ePub 15 06-30-2011 10:57 AM
[Error] Metadata "sequence" tag from FB2 simonbcn Calibre 0 08-30-2009 12:20 PM


All times are GMT -4. The time now is 10:16 AM.


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