Hi,
I use Vista Ultimate x64 with all the latest patches.
I have setup IIS 7 on my machine and I can access the local website using http://localhost.
In IIS, I have changed the MIME type for "*.html" documents to be served as "application/xhtml+xml".
I have created a couple of XHTML documents (XHTML 1.0 Strict DTD) and placed them in the web directory. One of them is a well-formed XHTML document validated with W3C Validation service. In the other document, I have omitted the closing angle bracket of the End Tag of the html element (e.g. "</html").
Now this is what happens when I open the pages in IE 7 and Firefox:
In IE, I open testpage1.html by typing "http://localhost/testpage1.html" and it works perfectly. When I open the other document "http://localhost/testpage2.html" it still opens but shows a "</html" string at the end because of the wrong tag syntax (omitted angle bracket).
In Firefox, the http://localhost/testpage1.html works fine and when I access http://localhost/testpage2.html it displays the following error message:
XML Parsing Error: unclosed token
Location: http://localhost/testpage2.html
Line Number 14, Column 1:
</html
^
Now the behavior of Firefox is understood and it is as per the specifications of XHTML 1.0. And it also proves that the documents are indeed served as XHTML. If the documents weren't served as XHTML, Firefox wouldn't have displayed the above error message which was evident from another experiment where I configured the pages to be served as "text/html".
However, I don't understand why IE 7 opens both the XHTML documents because I have read at so many places that IE doesn't support XHTML documents served as "application/xhtml+xml". From what I read, I understand that IE 7 should instead prompt me to download and save the files instead of displaying them.
Here is the markup of testpage1.html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<title>Test</title>
</head>
<body>
<p>Test XHTML</p>
</body>
</html>
In testpage2.html, I have copied the same markup and only removed the last angle bracket (last line would read "</html") to simulate an error.
Can somebody explain why IE7 which doesn't support "application/xhtml+xml" behaves in the way mentioned above?
Am I missing something? Is the default configuration of the IIS 7 has something to do with this?
Thanks
EDIT:
I will also like to add that I have checked the HTTP Response Headers for both IE and Firefox. In both cases the "content-type" is set to "application/xhtml+xml". I am inclined to believe that this behavior of IE has something to do with file name extension (".html" or ".xhtml").