« How to have Multiple Namespaces per Name | Main | Vista DRM Hell: Why I'm really dubious about upgrading to Vista »

Version Numbers in X/HTML, HTML, and XHTML

I'm just starting to get my mind wrapped around the issues of version numbers in X/HTML, HTML, and XHTML. There is pushback on whether version identifiers are a good thing at all, which has taken me a bit aback. I've started to write up a "Version identifiers considered useful" post but I want to cogitate a bit more on the various systems of HTML, CSS, etc. I've just posted a few thoughts on problems with a single namespace name as the version identifier in XML, and it's clear that the version identifier mapping problem applies to more systems than XML.

My early thinking is that one of the reasons why HTML and CSS might not want version identifiers is because of the version identifier mapping problem.

The WHAT WG wrote up HTML vs XHTML which says that there will effectively be no version information.

if the mime-type is application/xml or application/xhtml+xml, then the document must be XML and therefore XHTML
else, if the mime-type is text/html, then the document must be HTML and will contain <!DOCTYPE html>

Further, the html element may contain an xmlns attribute containing the xhtml namespace, ie
<html xmlns="http://www.w3.org/1999/xhtml">

On the face of it, this seems very simple but perhaps too simple?

Imagine you are a document author, and you create the following text:
<html>
<body>
<p>Hello World</p>
</body>
</html>

Which versions of (x)html is it? Well, it's almost all of them! But, you've got to serve it as three different documents under html 4, html 5, and xhtml 2. We'll put the xmlns declaration in all of them to make single sourcing the markup content consistent. Note: MovableType and Google and lots of others don't do this. I hear from TV Raman that saving the 30 characters or so is a *huge* win for google.

The 3 "versions" are:

text/html (for version 4)
<!DOCTYPE html "-//W3C//DTD HTML 4.0 Transitional//EN"gt;
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<p>Hello World</p>
</body>
</html>

text/html (for html 5)
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<p>Hello World</p>
</body>
</html>

application/xml:
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<p>Hello World</p>
</body>
</html>

Note with HTML, there's NO way of knowing whether this is version 5, 6, 7, 5.01, 5.1 or whatever. Seems a bit crazy to me but I'll have to do some more digging.

I wonder if there's any way to "fix" the version identification problem, or whether it needs to be fixed. I'll post some follow on thoughts as the gel a bit more.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About

This page contains a single entry from the blog posted on April 20, 2007 12:43 PM.

The previous post in this blog was How to have Multiple Namespaces per Name.

The next post in this blog is Vista DRM Hell: Why I'm really dubious about upgrading to Vista.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.34