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-005Error while parsing file: …RSC-016Fatal Error while parsing file: …HTM-004Irregular DOCTYPE: found "…", expected "…".HTM-011Entity is undeclared.RSC-001File "…" could not be found.RSC-002Required META-INF/container.xml resource could not be found.RSC-003No rootfile tag with media type "application/oebps-package+xml" was found in the container.RSC-004File "…" is encrypted, its content will not be checked.RSC-006Remote resource reference is not allowed in this context; resource "…" must be located in the EPUB container.RSC-006bResource "…" 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.