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">
to
Code:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" xmlns:epub="http://www.idpf.org/2007/ops">
But now I get loads of errors!
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