Skip to content
EPUBCheck · XHTML content documents

EPUBCheck HTM-009: obsolete DOCTYPE to remove

Updated:

EPUBCheck HTM-009 is an error message: “The DOCTYPE provided is obsolete or irregular and can be removed.” A document's DOCTYPE is obsolete or irregular and can simply be removed. EPUB only allows a few external identifiers in DOCTYPEs (for MathML, the NCX and SVG 1.1); anything else is reported.

The official message

The DOCTYPE provided is obsolete or irregular and can be removed.

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

Typical causes

  • Old DOCTYPEs kept from earlier versions of the book, such as XHTML 1.1 or HTML 4 identifiers.
  • A DOCTYPE added by an editor or converter that uses a web template for every file.

How to fix it

  1. 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.
  2. Remove the DOCTYPE line, or replace it with <!DOCTYPE html> in XHTML content documents.
  3. Check that the file still has its XML declaration and the html element with the XHTML namespace xmlns="http://www.w3.org/1999/xhtml".
  4. Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.

When it's not this

If EPUBCheck tells you which DOCTYPE it expected instead, the message is HTM-004.

Terms used here

Other HTM messages

  • HTM-010 Namespace "…" is unusual for the prefix "epub".
  • HTM-007 Empty or whitespace-only value of attribute ssml:ph.
  • HTM-011 Entity is undeclared.
  • HTM-004 Irregular DOCTYPE: found "…", expected "…".
  • HTM-003 External entities are not allowed in EPUB v3 documents. External entity declaration found: ….
  • HTM-001 Any publication resource that is an XML-based media type must be a valid XML 1.0 document. XML version found: ….

Sources

Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.

FAQ

What does EPUBCheck HTM-009 mean?

EPUBCheck HTM-009 is an error message: “The DOCTYPE provided is obsolete or irregular and can be removed.” A document's DOCTYPE is obsolete or irregular and can simply be removed. EPUB only allows a few external identifiers in DOCTYPEs (for MathML, the NCX and SVG 1.1); anything else is reported.

Is HTM-009 an error?

HTM-009 is reported as error by default. 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.