Application/xhtml+xml renders ok in IE8?

I’ve been reading this site and lately especially this thread and find it very informative. I’ve been using XHTML for as much time as I’m a conscious developer, and I admit - kind of a ‘victim’ of the XHTML hype, not realizing fully what it was in the first place back in the years. First, I was using HTML in ancient times some 6-7 years ago.
I don’t like where HTML(5) is headed to, there are still no clear standards, some browsers do implement some things, and we will have to reiterate the well known hell from when IE5/6, Netscape 4.x etc. were widespread.

But I wanted to point on something - the IE8/9 application/xhtml+xml support and the alleged download dialog they throw upon it.

[QUOTE=felgall;4538012]The following page is done using PHP to add the MIME type header before the page is sent to the browser.

http://www.felgall.com/realxhtml.php[/QUOTE]
I tried this in IE8 and 9, this page is rendered prefectly in both, no download dialog, no nothing. I double checked - the server sends the content type HEADER as application/xhtml+xml.

So where is the catch here? These are machines with Win7, and no registry hacks were ever applied. I kept reading here how IE (even 9) would offer real XHTML for downloading, still I do not witness this.

Thanks in advance for any explanation.

IE9 and all other modern browsers can handle XHTML properly without offering it for download.

If you are not seeing it happen then you are probably serving the page with the wrong MIME type.

Whether a page is HTML or XHTML is determined by whether the MIME type is text/html or application/xhtml+xml - what doctype is used is irrelevant.

felgall, thanks for replying so fast.
What I meant was I tried your link (opened it in various browsers), and even in IE8 it opens right. Although I could just try and write this myself, you’ve done it and I used it directly for the test. Obviously you created it to demonstrate the correct MIME type, which is what it does, still IE8 opens it right.
Also I read here that even IE9 wouldn’t support XHTML and its related MIME type. Thus my confusion.

I’m in the process of looking around to update my front-end skills (I’m mainly PHP with mysql/ms sql) and wondered to what degree I could count on HTML5 right now…

To my knowledge M$ IE9 was the MS first browsers to properly support ‘application/xhtml+xml’ thus assuming you have IE9 is should display. If you only have a standalone IE8 it would ask you to save or download, etc. All my pages are ‘application/xhtml+xml’ to those browsers that support the MIME or given ‘text/html’ to the legacy browsers.

Attempting to open my real XHTML test page in IE8 will result in the file being offered for download. If it actually opens the page then it either isn’t IE8 (or earlier) or you have somehow installed a plugin into IE8 that adds XHTML support. If the latter then I would be interested in knowing what plugins you have installed so as to work out which is adding that support. IE8 definitely offers that as a file for download when I try to access it using that browser (I just retested it and it displayed the save as dialog instead of the page). Tests I have done in IE9 do result in the page being displayed however if you try opening my [URL=“http://www.felgall.com/invxhtml.php”]broken XHTML page it also opens in IE9 when it shouldn’t. Restesting that page in the latest version of Opera shows that Opera now also opens it rather than correctly displaying an error message the way it used to so it looks like the latest version of Opera has worse XHTML support than earlier versions - since having the page not display iof there are errors is one of the main benefits of using XHTML in the first place.

Given that IE8 and earlier offer XHTML pages for download instead of displaying them, anyone trying to use them for live web pages and not just trying to demonstrate whether the browser does or doesn’t support it will test to see if the browser supports it and will dynamically change the MIME type to the HTML version for those that don’t. Of course this may lead to complications in any JavaScript that needs to interact with the page as the HTML and XHTML DOM are different and so generally people just serve the pages as HTML to everyone.

Actually it is a relatively rarely updated Win7 (virtual machine), I attach two screens:

http://img716.imageshack.us/img716/6603/ie8xhtml1.png

http://img844.imageshack.us/img844/8393/ie8xhtml2.png

I have nothing installed in IE, this is a machine used seldom, I intended to keep it because of the IE8 that is not WinUpdated to 9.
As you can see, no download, but displayed correctly.

For now I have no explanation, but I didn’t start diving deeply in browsers compatibility yet.

The only thing I can think of then is that it is the Win 7 VM that is supplying the XHTML support. IE is so closely tied into the operating system that it is possible that it behaves differently on different versions of Windows. It definitely offers the page for download in IE8 on Win XP.

(Thread moved and split into topic of its own.)

zcorpan sent: http://my.opera.com/ODIN/blog/2011/09/28/no-more-xml-parsing-failed-errors cause I was wondering about it