All books must adhere to EPUB standards. To ensure quality content, your book must pass validation at the time of import. There are a few issues commonly encountered with books that prevent them from importing into the Apple Books system. Review all books carefully to ensure that the following are addressed prior to delivery:
All books must pass Transporter validation.
All characters in the URIs must be valid with non-alphanumeric characters properly encoded (for example, space should be encoded as '%20'). This problem most often surfaces in URIs in the NCX files and is due to spaces included in filenames.
All files included in EPUBs must be listed in the book manifest (OPF file). Books containing unmanifested files will fail import, as these files are by definition not intentionally included.
Only UTF-8 and UTF-16 encodings are allowed in books. Any books that are improperly encoded will fail import, so it is important to use the correct character encodings.
The maximum book size is constrained by the ZIP standard, and is currently 2 GB.
If you use custom attributes, they must be HTML5 data attributes. A data attribute is an attribute that exists outside of a namespace and starts with the string data-
.
For more information on HTML5 data attributes, see:
http://www.w3.org/TR/html5/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes
Example:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
<head>...</head>
<body
...
<p class="text" data-name="value">text</p>
...
</body>
</html>
Namespaces define the XML vocabularies that contain the elements and attributes you're using in the EPUB’s content documents. Each namespace is declared using a URL and the attribute xmlns
or xmlns:
. For example, xmlns:xhtml="http://www.w3.org/1999/xhtml"
.
In the above declaration, xmlns:
is the attribute and xhtml
is its prefix. After you declare it, you can use the prefix in front of any element or attribute name separated by a colon. This identifies which XML vocabulary that element or attribute is referencing.
If a delivery ends in an error related to an element or attribute that’s not allowed, the specific element or attribute you're using might not be in the namespace vocabularies declared in the EPUB. To resolve the issue, change the element or attribute to one that is valid.