<< Weblog Software Upgraded | Home | Save Me From the Good People >>

The Courage to Serve XML

I didn't realize this until yesterday: all your painstakingly crafted XHTML web pages, well-formed, and validated against the DTD, are served by the typical web server as "text/html".

As such, the browser will treat them just as good old HTML. All the close tags that you inserted, all the quotes around attributes, and the silly <br /> tags, are treated as superfluous or quirks.

I learned this on a public debate at Norman Walsh's Weblog.

And he served the a subsequent blog as application/xhtml+xml, the correct MIME type for XHTML pages.

And guess what? It rendered perfectly in Mozilla.

I remember in the early days of XML, pundits often say, "If you have an XML browser, you can do blah blah blah." Now that we all have XML browsers, where are the XML web sites?

Do you dare to serve your website as XML?



Re: The Courage to Serve XML

Not if you want it to work in Internet Explorer. Unfortunately IE doesn't understand how to deal with application/xhtml+xml, it just pops up a download dialog. Another "wonderful" thing about IE is that it sends an Accept header of */*. Beautiful. And people were worried that MS's monopoly would hurt innovation...

Re: The Courage to Serve XML

I know. I know.

I just feel that it is such a waste of time and energy to write valid XHTML if they are going to be treated as defective HTML anyway.

Re: The Courage to Serve XML

There are problems with both approaches, unfortunately. http://www.hixie.ch/advocacy/xhtml

Add a comment Send a TrackBack