Coding with Jesse

This site is valid XHTML 1.1

April 21st, 2005

That's right, I've updated this site so it is now valid XHTML 1.1. It was previously XHTML 1.0 Strict. So what did I have to change?

  1. I changed the DOCTYPE tag to:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  2. I had to remove the "lang" attribute from the <html> tag. Now, only the xml:lang attribute is allowed.

That's it! Not too bad at all. I was also looking at what's coming in XHTML 2.0. I really like what I see. The downside is that XHTML 2.0 will not be backwards-compatible. The upside is, from what I can tell, it won't be very difficult to port an XHTML 1.x page to XHTML 2.0.

It looks like most web pages will only need to worry about a few things like the elimination of the <img> tag (this won't matter to those using CSS to add images), and the replacement of h1-h6 tags with a single <h> tag. However, it seems that pages with lots of JavaScript forms will need to have a major rework: HTML forms are replaced with XForms, JavaScript Events with XML Events. I guess we'll need to wait and see what the final specification has to say.


1 . SLV Dweller on February 25th, 2007

SLV Dweller

I'll mention that changing the DOCTYPE and the xml:lang attribute are not the only two things needed to turn your site into a valid XHTML 1.1 site. The most important thing that's needed is to serve the site with the MIME type of application/xhtml+xml. Running this page on the validator URL below, it seems you're actually serving this page as text/html, and the DOCTYPE is actually set for XHTML 1.0 Strict. I haven't read any other entries on your site, so maybe this is just as you designed it.

2 . h-christian on July 17th, 2007


wow great! it's also valid xml too via Microsoft MSXML. many xhtml 1.1 valid pages i've look around is not valid msxml validation

greeting from indonesia

Comments are closed, but I'd still love to hear your thoughts.