[html5] Updating to XHTML 1 to HTML5

Ian Hickson ian at hixie.ch
Thu Sep 2 03:05:37 PDT 2010


On Thu, 2 Sep 2010, Brenton Strine wrote:
> On Wed, Sep 1, 2010 at 9:36 PM, Ian Hickson <ian at hixie.ch> wrote:
> >
> > If you were using XHTML 1.1 correctly, you generally don't have to do
> > anything (not even change the MIME type or DOCTYPE). However, you can
> > check here:
> >
> >    http://html5.validator.nu/
> 
> I am talking about abandoning XHTML and moving over to HTML5.

Oh if you want to switch from XHTML to HTML (any version), then that's a 
bit more work. You'll have to change from the XML syntax to HTML. Easiest 
way is just to change the MIME type and then run it through Henri's 
validator above, and fix what it says is wrong.


> I assume that serving it as application/xhtml+xml when the document will 
> no longer necessarily be enforcing strict XHTML syntax, (e.g. 
> abbreviated boolean attributes) is not going to work

I assumed you wanted to continue using XHTML. HTML still has an XML 
variant that can be used with no problem, including using all the new 
features.


> and likewise, wouldn't the doctype need to be switched as well?

No, the most recent old DOCTYPEs continue to be fine to use. The DOCTYPE 
is mostly ignored anyway. In XML you can omit it altogether. In HTML so 
long as it's one of the valid ones (as listed in the spec) you're fine. 
The validator will let you know if the DOCTYPE is not one of the valid 
ones.


> I guess I was more wondering if there are XHTML syntactical things that 
> are not valid HTML5,

HTML is not XML, so yes, there's lots of things that won't work, e.g. 
<![CDATA[ ]]>, or using the "/>" form on elements the spec doesn't 
explicitly say are "void elements" (so e.g. <img/> is fine, but <div/> is 
not -- the slash is just ignored in both cases).


> or even things like MathML... will HTML5 understand valid XHTML MathML?

More or less, yes.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the Help mailing list