View Single Post
Old 07-01-2022, 03:47 PM   #223
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,997
Karma: 169810634
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Solo1959 View Post
I have had this very same problem. Just for giggles, I decided to try making the epub using Sigil. And it worked!

I noticed a difference on the top of the page of each file. In the Sigil creations there was this:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
Quote:

In the Calibre creations there was this:

<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

I don't know what any of those heading do, but I do know that the Sigil version did get accepted by Amazon. And the Calibre one did not.
The creator of calibre, Kovid Goyal stated a while back:
Quote:
As I have said before, you do not need doctypes in your ebooks. They serve no useful purpose. That remains just as true for EPUB 3 as it is for EPUB 2. The HTML standard has moved away from DTD (A DTD is what a doctype declares). As such I have no intentions of supporting doctype in calibre, regardless of versions of epub.
Which is pretty much correct in terms of uselessness. The problem is the HTML specs which state:

Quote:
All HTML documents must start with a <!DOCTYPE> declaration.

The declaration is not an HTML tag. It is an "information" to the browser about what document type to expect.
For HTML5 used in epub3, the declaration is pretty simple - <!DOCTYPE html> - while for HTML4, it must include a DTD declaration.

My personal choice is to use Sigil as my epub editor of choice. Opening a calibre generated epub with Sigil will result in an error message:
Click image for larger version

Name:	Screenshot 2022-07-01 124315.png
Views:	108
Size:	10.0 KB
ID:	194682

You can either hit yes here or run Mend and prettify all HTML files or Mend all HTML files from the Reformat HTML option in the Tools menu. Note that EpubCheck no longer returns a missing Doctype as an error.

So far doing that and making sure EpubCheck returns no errors has allowed me to test the email to Kindle without issue.
DNSB is offline   Reply With Quote