Is '.xhtml' extension is required or recommended in ePub3?

2 posts / 0 new
Last post

What is the difference between the '.html' and '.xhtml' file extensions?
Is '.xhtml' extension is required or recommended in ePub3?
Is there any problems/issues in usage of '.html' file extension in ePub3?

I have understand xhtml content documents must meet all of the 'document properties' as mentioned in section 2.1.1 (http://www.idpf.org/epub/301/spec/epub-contentdocs.html):
1. XML conformance
2. XHTML syntax conformance
3. HTML5 conformance

All the above rules are required.
But 'File properties' (that is, '.xhtml') extension is recommended only.
The current version of epubcheck 3.0.1 doesn't report any errors or warnings regarding this issue.
Also I have found more information in section 1.5 (http://www.idpf.org/epub/301/spec/epub-contentdocs.html) and RFC2119.
Please any one advice or correct my understanding.
It would be of great help, if you all please share your view to this problem.

The one useful difference I'm aware of is that using ".xhtml" can trigger xhtml processing of a local file in some browsers, which makes debugging your content prior to opening it in a reading system easier (chrome, for example, will use its XML parser when opening local files with that extension).

The media type specified in the package document is the more precise indicator to a reading system, which is why there is only a recommendation on the file extension.

I'm not surprised epubcheck doesn't bother to verify file extensions, though, since it would be a largely pointless warning to force on people. Your content isn't invalid if you choose an html extension instead.

Secondary menu