When I first read the HTML 5 specs I was very disappointed about the rampant promotion of tag soup in there. It felt almost criminal to go back to that. Yet, XHTML 5 seems not a solution to it thanks to a combination: - browsers like IE8 and older as they don't do the right thing - the "thou shall not serve XHTML as text/html" mantra It would force one to keep 2 versions of the same - I'm not even considering.
Back when I used to start with xhtml 1.1 I did it in such a way that existing browsers would deal with it properly, even while it meant I had to serve it as text/html due to the browser's lack of foresight. Over the years I've continued this, but I'm slowly discovering an alternative that could allow me to move to xhtml 5 without having to tell a lot of my visitors that their browser is too far below par or having to keep 2 versions.
It seems you can make xhtml 5 that is also valid HTML 5. It even has a name: "Polyglot (X)HTML (5)".
You need to combine this with something that detects if the browser is ready to accept application/xhtml+xml content ... luckily the browser tells you via the accept header it sends in the request.
And that can hence e.g. be done in your apache configuration with rewrite rules:
Essentially: one takes care and follows some simple rules and you get all the benefits of having proper xml instead of a big mess, strict validation through delivery of your xml to browsers that can do draconian validation (refuse to render invalid code), and you get backward compatibility with retarded browsers by delivering it as if it were HTML 5 to them without having to keep 2 copies.
My questions: - has anybody out here played with it already ? - you need to be careful with html entitites as only a very few are allowed anymore it seems (per the w3 draft) - e.g. PHP htmlentities() would need to be changed from what I see it do. - any experience in integrating it with 3rd party stuff like adsense / something like google maps/ ... (scripts get some serious limit) - other pitfalls ?
please: I'm not trying to start a xhtml vs html discussion - been there done that, nobody got a T-shirt. I'm just interested in experiences with doing this and where the limits are to where we can push it - for those convinced to do it regardless.