HTML5, XHTML5, polyglot XHTML5

Discussion about HTML and XHTML related issues.
Post Reply
User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3407
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

HTML5, XHTML5, polyglot XHTML5

Post by Albert Wiersch » Thu Jun 28, 2012 11:05 am

Someone brought this page about HTML5, XHTML5, and polyglot XHTML5 to my attention and I thought it was a good read:
http://www.xmlplease.com/xhtml/xhtml5polyglot/
HTML5 has so many syntax options that at least some web designers and developers prefer to use a consistent subset. In HTML5
almost anything in both old XHTML and HTML are allowed in the same valid document. With no self-imposed restrictions, HTML5
markup has a tendency to attract dirt attracting more dirt. In this tutorial we don't look at all the nice new features in
HTML5. We focus on what basic subset to use.
Image
Albert Wiersch

User avatar
MikeGale
Rank VI - Professional
Rank VI - Professional
Posts: 704
Joined: Mon Dec 13, 2004 1:50 pm
Location: Tannhauser Gate

Re: HTML5, XHTML5, polyglot XHTML5

Post by MikeGale » Thu Jun 28, 2012 4:26 pm

Thanks for posting the link.

In recent years I've lost hope of finding many intelligent articles on the web. This is an example of somebody engaging the brain before writing. Refreshing to see.

The article gives a great illustration of why HTML5 will encourage and maybe even accelerate the existence of unprofessional markup on the web. When the HTML5 team rolled over in the face of the rubbishy markup, they actually sided with rubbish making. The article shows how it puts us on that slippery slope.

(It also alludes to, what I think is, a foolishness in XHTML design, lower case only.)

The good thing is that it goes on to illustrate how you can produce markup that is professional, even in the face of that hostile decision about how you indicate XHTML in HTML5.

I'll read the article again.
Last edited by MikeGale on Thu Jun 28, 2012 5:06 pm, edited 1 time in total.

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3407
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: HTML5, XHTML5, polyglot XHTML5

Post by Albert Wiersch » Thu Jun 28, 2012 4:31 pm

MikeGale wrote:When the HTML5 team rolled over in the face of the rubbishy markup, they actually sided with rubbish making.
Yes, but I don't think it was really their choice since they realized they had to be practical, and forcing valid markup just isn't the way the world works. :D

I agree that it was a refreshingly informative & thoughtful article... and that is rare these days.
Image
Albert Wiersch

User avatar
MikeGale
Rank VI - Professional
Rank VI - Professional
Posts: 704
Joined: Mon Dec 13, 2004 1:50 pm
Location: Tannhauser Gate

Re: HTML5, XHTML5, polyglot XHTML5

Post by MikeGale » Fri Jun 29, 2012 4:55 am

I've given the ideas in the article a first try.

It mentions using both content types on the same file. (If I read it correctly.)

This is not something I've seen before but seems a great idea, and sensible.

I can't get a header syntax that works in all browsers.

I've tried:
Content-Type: text/html application/xhtml+xml; charset=utf-8
and
Content-Type: text/html, application/xhtml+xml; charset=utf-8
that's the raw appearance of the headers as they are sent into the wire.

I can get both to work in FF13 but not in IE8. Obviously one browser failing is too many! I only found reference to one type (i.e. the only approach I've used before) in my online searching.

Anybody know a universal syntax for having two content types in one document?

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3407
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: HTML5, XHTML5, polyglot XHTML5

Post by Albert Wiersch » Fri Jun 29, 2012 7:01 am

MikeGale wrote:It mentions using both content types on the same file. (If I read it correctly.)
I don't think it means using both at the same time, just that you can use either, and the same document is still valid for whichever you choose because it validates for both HTML5 and XHTML5.
Image
Albert Wiersch

User avatar
MikeGale
Rank VI - Professional
Rank VI - Professional
Posts: 704
Joined: Mon Dec 13, 2004 1:50 pm
Location: Tannhauser Gate

Re: HTML5, XHTML5, polyglot XHTML5

Post by MikeGale » Fri Jun 29, 2012 4:36 pm

You may be right.

My prior understanding was that there was one and only one type. From the article it's evident that conceptually that's wrong and restrictive. Hopefully the framers of the spec. thought that through and allowed. (I did have a look at one of the specs but didn't find anything on this.)

Then I found that at least one browser accepts multi-type syntax, so others have acted on that and produced a parser that does something. Confirming in a deep but subtle way that it's important.

The issue then becomes whether all browsers can work with the syntax (once we know the official version, and whether our programming tools can easily insert it!).

(This strengthens my impression that the current HTML5 design deliberately makes XHTML5 hard to do. It's one thing to allow people to get away with bad markup, and a totally different thing to actively prevent creation and use of good markup.)

User avatar
MikeGale
Rank VI - Professional
Rank VI - Professional
Posts: 704
Joined: Mon Dec 13, 2004 1:50 pm
Location: Tannhauser Gate

Re: HTML5, XHTML5, polyglot XHTML5

Post by MikeGale » Tue Jul 10, 2012 8:44 pm

I got feedback from Jesper, who wrote the original article. He was referring to sending a single MIME type.

My take on this is that browser behaviour is unreliable. (I think that IE 8 actually has a bug here!) I've only tested on two browsers.

Does anybody here know how I can get an indication (on the rendered page) of what parser was used. It would be great if I could have a test page that had "this paged parsed as ...." on the bottom.

Post Reply