[html5] Identifying HTML 5 documents? (vs. alternate flavors)

Jim Correia jim.correia at pobox.com
Mon Feb 4 07:28:37 PST 2008

I know there has been some discussion about this on the forum. But  
after having read through the draft spec and the FAQ, I'm still a  
little unclear about how I can auto-detect that a document is using  
HTML 5. (Or more precisely, that the author of the document intended  
it to be conformant to HTML 5.)

I have a conformance checker tool which needs to autodetect the flavor  
of HTML in use so it can determine which particular set of conformance  
tests to apply to the document. (We may be talking about a single  
document, or traversing a directory tree and processing all documents  
in the tree. In either case, the document type should be auto detected.)

For HTML syntax, the shorted form of the doctype "<!DOCTYPE HTML>" is  
required. This is sufficiently different from all previous doctypes  
that it can be mapped to HTML 5. But since there is no version  
information included in the doctype, what happens when the successor  
to HTML 5 comes out?

For XHTML syntax, the doctype is to be omitted. In this situation, how  
should I autodetect that we are using XHTML 5 as opposed to some other  

- Jim

More information about the Help mailing list