|
![]() |
|
Thread Tools | Search this Thread |
![]() |
#1 |
Member
![]() ![]() ![]() ![]() Posts: 19
Karma: 302
Join Date: Dec 2010
Device: Kindle
|
The prefix "epub" for attribute "epub:type" associated with an element type "nav" is
Hi,
I am deeply apologetic for the length of this message but I'm going through my files and attempts to create a valid epub. I created an epub in late 2023 and had no problems and I'm using the same template to create a new epub, but when I run it on the various epub checking websites ( https://www.bookmarketing.pro/epub-validator.html, https://draft2digital.com/book/epubcheck/upload, https://www.epubconversion.com/epub-validator/ and https://bookery.app/epub_validation ) I get the following error(s). I guess that in the two year's gap something has changed in the validation process. Can anyone help please? These are the errors: Code:
FATAL(RSC-016): epub/OEBPS/text/contents.xhtml(13,35): Fatal Error while parsing file: The prefix "epub" for attribute "epub:type" associated with an element type "nav" is not bound. ERROR(RSC-005): epub/OEBPS/text/contents.xhtml(-1,-1): Error while parsing file: The prefix "epub" for attribute "epub:type" associated with an element type "nav" is not bound. -------------------------------------------- This is the contents.xhtml file - its practically the same as the epub I created over a year ago with no problems. I've indicated with a /* .. */ where line 13, the source of the errors, is I've omitted much of the file as its just a repetitive listing of county name in the UK Code:
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <link href="../styles/mystyle.css" rel="stylesheet" type="text/css"/> <meta http-equiv="default-style" content="text/html; charset=utf-8" /> <title>Contents</title> </head> <body> <h2>Contents</h2> <hr/> <nav id="toc" epub:type="toc"> /* error */ <table class="centertable"> <tr> <td> <a href="sameauthor.xhtml">By the same author</a> </td> </tr> <tr> <td> <a href="intro.xhtml">Introduction</a> </td> </tr> <tr> <td> <a href="updates.xhtml">Updates</a> </td> </tr> </table> <hr/> <table class="centertable"> <tr> <td> England: </td> <td> </td> </tr> <!-- rest of contents omitted for brevity --> </table> </nav> </body> </html> My toc.ncx reads (with repetitive elements removed for legibility) Code:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html> <ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1"> <head> <!--<meta name="dtb:uid" content="9781471652950"/>--> <meta name="dtb:depth" content="1"/> <meta name="dtb:totalPageCount" content="447"/> <meta name="dtb:maxPageNumber" content="447"/> </head> <docTitle> <text>Volume 2: Hotels</text> </docTitle> <navMap> <navPoint id="navpoint-1" playOrder="1"> <navLabel> <text>Cover</text> </navLabel> </navPoint> /* Extraneous elements snipped */ </navMap> </ncx> Based on this reply in this forum ( https://www.mobileread.com/forums/sh...d.php?t=285158 ) I've changed the head in toc.xhtml from Code:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> Code:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" xmlns:epub="http://www.idpf.org/2007/ops"> Code:
ERROR(RSC-005): /OEBPS/text/contents.xhtml(16,28): Error while parsing file: element "table" not allowed here; expected element "h1", "h2", "h3", "h4", "h5", "h6", "hgroup" or "ol" ERROR(RSC-005): /OEBPS/text/contents.xhtml(38,6): Error while parsing file: element "hr" not allowed here; expected element "h1", "h2", "h3", "h4", "h5", "h6", "hgroup" or "ol" ERROR(RSC-005): /OEBPS/text/contents.xhtml(40,28): Error while parsing file: element "table" not allowed here; expected element "h1", "h2", "h3", "h4", "h5", "h6", "hgroup" or "ol" ERROR(RSC-005): /OEBPS/text/contents.xhtml(461,6): Error while parsing file: element "hr" not allowed here; expected element "h1", "h2", "h3", "h4", "h5", "h6", "hgroup" or "ol" ERROR(RSC-005): /OEBPS/text/contents.xhtml(463,28): Error while parsing file: element "table" not allowed here; expected element "h1", "h2", "h3", "h4", "h5", "h6", "hgroup" or "ol" ERROR(RSC-005): /OEBPS/text/contents.xhtml(606,6): Error while parsing file: element "hr" not allowed here; expected element "h1", "h2", "h3", "h4", "h5", "h6", "hgroup" or "ol" ERROR(RSC-005): /OEBPS/text/contents.xhtml(608,28): Error while parsing file: element "table" not allowed here; expected element "h1", "h2", "h3", "h4", "h5", "h6", "hgroup" or "ol" ERROR(RSC-005): /OEBPS/text/contents.xhtml(628,7): Error while parsing file: element "nav" incomplete; missing required element "ol" It now seems that table and hr are not allowed in the contents file?! <hr> is used at the top of file to separate <h2>Contents</h2> from the rest of the file and seems to be OK but when I used to to separate the tables, it now grumbles. It doesn't seem to like the use of these tags when between <nav>. I'm especially bewildered about the final error, talking about the missing "ol" element. Can anyone help? With best wishes Paul |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,663
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Is your ebook an epub v3?
Have a look at this toc.xhtml which has no problems... https://paste.kodi.tv/ewelefubeh |
![]() |
![]() |
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,663
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Also, are you using Calibre or Sigil?
You should be able to easily recreate the TOC's with their built in TOC manager. |
![]() |
![]() |
![]() |
#4 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 47,789
Karma: 172313956
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
|
![]() |
![]() |
![]() |
#5 |
Member
![]() ![]() ![]() ![]() Posts: 19
Karma: 302
Join Date: Dec 2010
Device: Kindle
|
Thank you for your responses. I'm unable to check right now as I'm away from my files but to answer your question - when I validate the sites say that I am using ePub 3 (one site says 3.2).
the contents page is the only one I am using the table tag, which hr to delimit the different sections. It went through OK two years ago so I am using that the use of these two tags between <nav> is now deprecated (?) |
![]() |
![]() |
![]() |
#6 |
Member
![]() ![]() ![]() ![]() Posts: 19
Karma: 302
Join Date: Dec 2010
Device: Kindle
|
Hi,
I'm away from my files so I can't test this but thanks for your replies. I must be validating against epub 3 as at least some of the sites I am using say this. It looks to me like using hr and table tags between <nav> has been deprecated since two years ago it let me do this. I shall try replacing them with li and ol tags. Many thanks! |
![]() |
![]() |
![]() |
#7 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 80,525
Karma: 150249619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Here is a NAV ToC you can use as a sample.
Code:
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"> <head> <title>Probability Space</title> <meta http-equiv="default-style" content="text/html; charset=utf-8"/> <link rel="stylesheet" type="text/css" href="styles/stylesheet.css"/> </head> <body> <nav epub:type="toc"> <h2>Contents</h2> <ol epub:type="list"> <li><a href="xhtml/title.xhtml#tit">Title Page</a></li> <li><a href="xhtml/copyrightnotice.xhtml#notice">Copyright Notice</a></li> <li><a href="xhtml/dedication.xhtml#ded">Dedication</a></li> <li><a href="xhtml/acknowledgments.xhtml#ack">Acknowledgments</a></li> <li><a href="xhtml/epigraph.xhtml#epi">Epigraph</a></li> <li><a href="xhtml/prologue.xhtml#Pro">Prologue: Mars</a></li> <li><a href="xhtml/chapter1.xhtml#ch1">One: Cambridge, Massachusetts, United Atlantic Federation, Earth</a></li> <li><a href="xhtml/chapter2.xhtml#ch2">Two: Walton Spaceport, United Atlantic Federation, Earth</a></li> <li><a href="xhtml/chapter3.xhtml#ch3">Three: Lowell City, Mars</a></li> <li><a href="xhtml/chapter4.xhtml#ch4">Four: Luna City</a></li> <li><a href="xhtml/chapter5.xhtml#ch5">Five: En Route to Mars</a></li> <li><a href="xhtml/chapter6.xhtml#ch6">Six: Space Tunnel #1</a></li> <li><a href="xhtml/chapter7.xhtml#ch7">Seven: Lowell City, Mars</a></li> <li><a href="xhtml/chapter8.xhtml#ch8">Eight: World</a></li> <li><a href="xhtml/chapter9.xhtml#ch9">Nine: Gofkit Shamloe</a></li> <li><a href="xhtml/chapter10.xhtml#ch10">Ten: Lowell City, Mars</a></li> <li><a href="xhtml/chapter11.xhtml#ch11">Eleven: Lowell City</a></li> <li><a href="xhtml/chapter12.xhtml#ch12">Twelve: Gofkit Shamloe</a></li> <li><a href="xhtml/chapter13.xhtml#ch13">Thirteen: Gofkit Shamloe</a></li> <li><a href="xhtml/chapter14.xhtml#ch14">Fourteen: Tharsis, Mars</a></li> <li><a href="xhtml/chapter15.xhtml#ch15">Fifteen: World</a></li> <li><a href="xhtml/chapter16.xhtml#ch16">Sixteen: At Space Tunnel #438</a></li> <li><a href="xhtml/chapter17.xhtml#ch17">Seventeen: At Space Tunnel #438</a></li> <li><a href="xhtml/chapter18.xhtml#ch18">Eighteen: Lowell City, Mars</a></li> <li><a href="xhtml/chapter19.xhtml#ch19">Nineteen: Aboard the Murasaki</a></li> <li><a href="xhtml/chapter20.xhtml#ch20">Twenty: Aboard the Murasaki</a></li> <li><a href="xhtml/chapter21.xhtml#ch21">Twenty-One: Aboard the Murasaki</a></li> <li><a href="xhtml/chapter22.xhtml#ch22">Twenty-Two: Aboard the Murasaki</a></li> <li><a href="xhtml/chapter23.xhtml#ch23">Twenty-Three: Tharsis, Mars</a></li> <li><a href="xhtml/chapter24.xhtml#ch24">Twenty-Four: Caligula Space</a></li> <li><a href="xhtml/chapter25.xhtml#ch25">Twenty-Five: Tharsis, Mars</a></li> <li><a href="xhtml/chapter26.xhtml#ch26">Twenty-Six: Artemis System</a></li> <li><a href="xhtml/chapter27.xhtml#ch27">Twenty-Seven: In Q Space</a></li> <li><a href="xhtml/chapter28.xhtml#ch28">Twenty-Eight: Aboard a Faller Station</a></li> <li><a href="xhtml/chapter29.xhtml#ch29">Twenty-Nine: Q Space</a></li> <li><a href="xhtml/chapter30.xhtml#ch30">Thirty: Tharsis, Mars</a></li> <li><a href="xhtml/chapter31.xhtml#ch31">Thirty-One: Space Tunnel #1</a></li> <li><a href="xhtml/chapter32.xhtml#ch32">Thirty-Two: Tharsis Plain, Mars</a></li> <li><a href="xhtml/chapter33.xhtml#ch33">Thirty-Three: Space Tunnel #1</a></li> <li><a href="xhtml/chapter34.xhtml#ch34">Thirty-Four: Thera Station, Mars Orbit</a></li> <li><a href="xhtml/abouttheauthor.xhtml#ata">About the Author</a></li> <li><a href="xhtml/adcard.xhtml#add">By Nancy Kress</a></li> <li><a href="xhtml/newsletter.xhtml#new">Newsletter Sign-up</a></li> <li><a href="xhtml/copyright.xhtml#cpy">Copyright</a></li> </ol> </nav> <nav epub:type="landmarks"> <h2>Guide</h2> <ol epub:type="list"> <li><a epub:type="cover" href="xhtml/cover.xhtml">Cover</a></li> <li><a epub:type="toc" href="xhtml/contents.xhtml">Table of Contents</a></li> </ol> </nav> </body> </html> |
![]() |
![]() |
![]() |
#8 |
Member
![]() ![]() ![]() ![]() Posts: 19
Karma: 302
Join Date: Dec 2010
Device: Kindle
|
Thank you, I managed to get it to work, replacing the table elements with ol and li, and do some re-formatting. I can use this as a template for another epub I'm working on
|
![]() |
![]() |
![]() |
#9 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,663
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Quote:
Assuming you have <h> tags for your chapter headings. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Browser Viewer: Request to hide <aside epub:type="noteref"> | nqk | Calibre | 7 | 07-11-2018 12:49 AM |
Can a file have multiple semantic tags (epub:type, reference type="…")? | jcsalomon | ePub | 7 | 02-19-2018 11:40 AM |
[Suggestion] Sigil validator should check missing type="text/css" attribute | quiris | Sigil | 13 | 01-21-2018 02:00 PM |
The element type "p" must be terminated by the matching end-tag "</p>". | uieluck | ePub | 10 | 02-12-2013 07:04 PM |
"ELF binary type "0" not known" Error. When run Kindlegen | chovan | Amazon Kindle | 4 | 02-09-2012 11:49 AM |