Skip to content
Glossary

What is XHTML in EPUB?

Updated:

EPUB content documents are XHTML: HTML written with XML syntax, so every tag must be closed, attributes quoted and the file well-formed. EPUB 3 uses the XHTML syntax of HTML5; EPUB 2 used XHTML 1.1.

Why it matters when you convert a PDF to EPUB

The text a converter extracts from a PDF must be escaped and nested correctly, or the whole chapter fails to parse; one stray "&" or an unclosed tag is enough. Parsing errors appear in EPUBCheck as RSC-005 (schema errors) or RSC-016 (fatal XML errors).

How EpubCC handles it: each chapter is written as XHTML with the HTML5 doctype, lang and xml:lang set to the detected language, and dir="rtl" for right-to-left languages. Every piece of text taken from the PDF is escaped (&, <, > and quotes), and characters XML does not allow, such as stray control characters left in some PDFs, are dropped, so a chapter never fails to parse because of its source text.

Related terms

EPUBCheck messages about this

  • RSC-005 Error while parsing file: …
  • RSC-016 Fatal Error while parsing file: …
  • HTM-004 Irregular DOCTYPE: found "…", expected "…".
  • HTM-011 Entity is undeclared.
  • RSC-001 File "…" could not be found.
  • RSC-002 Required META-INF/container.xml resource could not be found.
  • RSC-003 No rootfile tag with media type "application/oebps-package+xml" was found in the container.
  • RSC-004 File "…" is encrypted, its content will not be checked.
  • RSC-006 Remote resource reference is not allowed in this context; resource "…" must be located in the EPUB container.
  • RSC-006b Resource "…" is located outside the EPUB Container; please check the resource is retrieved in scripted content.

Convert a PDF to EPUB
Convert up to 5 pages free, no account needed.

FAQ

What is XHTML in EPUB?

EPUB content documents are XHTML: HTML written with XML syntax, so every tag must be closed, attributes quoted and the file well-formed. EPUB 3 uses the XHTML syntax of HTML5; EPUB 2 used XHTML 1.1.