Anne van Kesteren

A FAQ about (X)HTML

The first title in the HTML and XHTML Frequently Answered Questions is Why is XHTML needed? Isn't HTML good enough? Here are the reasons they give:

HTML is probably the most successful document markup language in the world. But when XML was introduced, a two-day workshop was organized to discuss whether a new version of HTML in XML was needed. The opinion at the workshop was a clear 'Yes': with an XML-based HTML other XML languages could include bits of XHTML, and XHTML documents could include bits of other markup languages. We could also take advantage of the redesign to clean up some of the more untidy parts of HTML, and add some new needed functionality, like better forms.

The only real advantage here is that you can use other XML languages by directly embedding them in your markup. In HTML, you would have to use the OBJECT element and it would be impossible to mix markup. The forms argument is just stupid, especially if we take a look at Web Forms 2.0, which is designed for HTML and is going to be supported in Internet Explorer by the use of HTCs (HTML Components, a Microsoft extension). No need for XHTML there and it is almost read for use. No need to wait another 20 years.

After that, they are talking about some advantages of using XHTML. They miss the advantages that it isn't supported by Internet Explorer, it will give a parse error in the browser when the content management tool is buggy and the real advantage, it will display faster; a document can only be correct or incorrect, no need for repairing it.

They do explain why it is allowed to send a document as text/html, but miss the fact that is incompatible. In Does Microsoft Internet Explorer accept the media type application/xhtml+xml? they forget to mention that Internet Explorer chokes on XML errors so it certainly uses a different parser than just the text/html parser as mentioned in the W3C FAQ. Another interesting part:

What XHTML2 does is say that all images are equivalent to some piece of content; it does this by allowing you to put a src attribute on any element at all. What this says is: if the image is available, and the browser can process it, use it, otherwise use the content of the element.

Is it only for images? Why is this better than:

p#intro{content:url(intro)}

Note that that solution works in HTML too! The most funny part of the FAQ is Why isn't XHTML2 backwards compatible? Here we go:

It is, but in a different way to how previous versions of HTML were backwards compatible.

I probably missed the fact that XHTML2 doesn't have a new namespace and doesn't have a new MIME type. I also wonder why XForms and XML Events are parts of XHTML2 instead of being specifications that can be mixed with XHTML2. I also wonder why they claim that some browsers already support it. Maybe they missed the fact that the example page of Sjoerd Visscher is heavily hacked and not really ready for deployment. And if XHTML2 gets a new MIME type, I thought it did; all is a myth and we have to wait like 20 years before we can use it or longer. We can't even use XHTML1 without some kind of hack yet.

End of nitpicking. Thanks for reading.

Comments

  1. Breathe Anne, breathe. :)

    Posted by Faruk Ates at

  2. I also wonder why they claim that some browsers already support it.

    There exists browsers that support XHTML and XForms. X-Smiles is one of them. It's worth a try. Terrible Java GUI, no CSS support, but pretty decent XForms support.

    Posted by Asbjørn Ulsberg at

  3. Hey Anne, you are in a good company with not being happy with xhtml/xml on the net. But besides all problems with mime types, http-header and the like, don't forget, that xhtml as it is xml is a better way to work with data on the server as you can more easily integrate it in other xml-based application, espacilly as we are now living in the age of php5 - the serversided xml-processing monster ;]

    ceterum censeo: i hope i didn't get offtopic to far...

    Posted by ben at

  4. Sounds Like I'll have a good laugh when reading the FAQ article later on.

    Posted by Robert Wellock at

  5. Anne, see my blog, I have quite a bit of a comment to make on that FAQ...

    Posted by Daniel Glazman at