Re: Transition to HTML5

On Fri, Apr 30, 2010 at 12:40 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Fri, Apr 30, 2010 at 10:34 AM, Jasper Magick <jasper.magick@gmail.com> wrote:
>> What is the most pain-free way of transitioning from XHTML1.0 Strict to
>> HTML5?
>> Some of what I read about HTML5 seems sloppy, like optional quotations
>> around values.
>> However, it seems like the better way to go since there are still some
>> (though few) browsers that still don't support XHTML (application/xhtml+xml)
>
> The easiest way?  Just swap your doctype to <!DOCTYPE html> and keep
> serving your page as text/html.  You've now transitioned to HTML5.
> ^_^  (Well, as long as you're not using some of the more xml-ish
> features like self-closing your <script src>s , but since you're
> probably serving your page as text/html right now, I doubt you're
> doing so.)
>
> You don't have to use the features like optional quotes.  Those exist
> partially because legacy browsers supported them, and thus legacy
> pages use them, and so we have to support them in some way to fulfill
> our goal of being compatible, and partially just because, well, it's
> unambiguous in many cases to omit the quotes, so why require them?
> You can always use quotes at all times if you wish, of course; it
> won't make your HTML invalid.

I should also add that if you can still serve your (X)HTML5 pages
using application/xhtml+xml. That makes you use the XML serialization
of HTML which does not support optional quotes around attributes.
However, as you point out, some UAs still don't support this. Though I
think the main one lagging behind is IE, which I think might support
it in the preview versions of IE9, so things are improving.

/ Jonas

Received on Friday, 30 April 2010 19:51:58 UTC