EPUBCheck HTM-001: XML version is not 1.0
Updated:
EPUBCheck HTM-001 is an error message: “Any publication resource that is an XML-based media type must be a valid XML 1.0 document. XML version found: ….” An XML file in the EPUB declares an XML version other than 1.0. EPUB requires every XML-based resource (XHTML chapters, the package document, the NCX, SVG images) to be a valid XML 1.0 document, and EPUBCheck names the version it found.
The official message
Any publication resource that is an XML-based media type must be a valid XML 1.0 document. XML version found: %1$s.
- Default severity
- Error. The EPUB breaks a rule of the specification and is invalid. Stores and Send to Kindle may reject it, and EPUBCheck exits with status 1.
- EPUBCheck version
- 5.4.0
%1$s, %2$s… are filled in with the file, value or element EPUBCheck found.
Typical causes
- An XML declaration that says version="1.1", written by an editor or an export tool that defaults to it.
- A template copied from another XML project and reused for every chapter.
How to fix it
- Open the file EPUBCheck names (the message gives the path, line and column) in a text or EPUB editor such as Sigil, or unzip the EPUB and open it there.
- Change the first line to
<?xml version="1.0" encoding="UTF-8"?>, or remove the XML declaration: without one, XML 1.0 and UTF-8 are assumed. - If the tool that made the book writes 1.1 in every file, fix its template so the next export is right.
- Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.
When it's not this
If the declaration says 1.0 but the file is saved in UTF-16, that is HTM_058, not HTM-001.
Terms used here
Other HTM messages
HTM-003External entities are not allowed in EPUB v3 documents. External entity declaration found: ….HTM-004Irregular DOCTYPE: found "…", expected "…".HTM-007Empty or whitespace-only value of attribute ssml:ph.HTM-009The DOCTYPE provided is obsolete or irregular and can be removed.HTM-010Namespace "…" is unusual for the prefix "epub".HTM-011Entity is undeclared.
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.