doctype for epub3 pages

2 posts / 0 new
Last post

What is the required doctype for epub3 pages? Is it ok if we have "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">"?

Thanks!

EPUB 3 uses XHTML5 for content documents, so a doctype isn't required. Adding the HTML5 doctype isn't harmful, either:

<!DOCTYPE html>

It has the benefit of triggering the correct validation in some XML editors, and I suppose could also avoid your content being rendered in quirks mode if it's incorrectly served up as text/html.

As HTML is no longer defined by DTDs, EPUB 3 removed the ability to reference external entities from the doctype. If you include an XHTML 1.1 doctype, you're going to get this error when you validate, as that's what it's attempting to do:

 

External entities are not allowed in XML. External entity declaration found: %OEBEntities

 

Secondary menu