Recommended Posts

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").

Edited by freak4ever
Link to comment
https://www.neowin.net/forum/topic/622602-ie-7-and-xhtml/
Share on other sites

  • 2 weeks later...
In IIS, I have changed the MIME type for "*.html" documents to be served as "application/xhtml+xml".

Don't do that, All it does is break normal HTML files and sends XHTML files (*.xhtml) as HTML.

And yeah, you can force IE to treat XHTML as HTML (even with the proper mimetype), Although it's easier to just send it the old mimetype.

Link to comment
https://www.neowin.net/forum/topic/622602-ie-7-and-xhtml/#findComment-589273074
Share on other sites

actually, IE (any version, even 8) doesn't support application/xhtml+xml at all, and all you'll get is a download prompt. so just the fact that it's displaying means that somewhere along the line something's ****ing up such that the page isn't being served as xhtml to IE.

edit: now that i think about it, since you assigned the mime type to .html, it's probably being served properly, but since IE can't handle mime types at all, it's just ignoring your mime type and guessing the page to be HTML from the extension, thus rendering it as HTML. The download prompt probably comes from just about everyone serving XHTML with a scripting extension (.php) so IE doesn't know what to do with it, hence a prompt.

Edited by Primexx
Link to comment
https://www.neowin.net/forum/topic/622602-ie-7-and-xhtml/#findComment-589276139
Share on other sites

Could you please follow these instructions and report back to us?

(1) Click "Start"

(2) Click "Run"

(3) Type "regedit" (without quotation marks)

(4) Click "OK"

(5) Expand "HKEY_CLASSES_ROOT"

(6) Expand "MIME"

(7) Expand "Database"

(8) Expand "Content Type"

Do you see a folder in the "Content Type" section titled "application/xhtml+xml"? If you do, this probably explains why you are not presented with a download prompt when accessing a document served with the "application/xhtml+xml" mimetype.

If you do see such a folder, click on it. To the right you will see some text, "CLSID". To the right of that text you'll probably see "REG_SZ" and "{25336920-03F9-11cf-8FD0-00AA00686F13}". If that is true, this explains why Internet Explorer is attempting to render the page instead of asking you if you want to download or not. That long string of numbers and letters basically tells programs to treat documents that are served with the "application/xhtml+xml" mimetype as if they were being sent with the "text/html" mimetype. As such, Internet Explorer interprets XHTML documents served with the "application/xhtml+xml" mimetype as regular HTML documents.

That could pose problems when upgrading Internet Explorer in the future. To ensure trouble-free upgrades, you should delete the "application/xhtml+xml" folder by right-clicking on it and then clicking "Delete." Once you delete the folder, restart Windows and test your document again—Internet Explorer should ask you if you want to download the file.

If you did see such a folder and deleted it, are you being asked to download the file? If you did not see such a folder, please reply and let us know.

Link to comment
https://www.neowin.net/forum/topic/622602-ie-7-and-xhtml/#findComment-589280531
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Wow, imagine you dump hundreds of hours into completing things and unlocking stuff and you lose it all. Back in the day when cheats were built into games, you could at least unlock things again that way without spending hundreds of hours again. But those days are long gone for some reason as no one builds cheats into games anymore. So it's even more painful that studio that's on its 6th installment **** it up so badly.
    • Spotify finally removes the disco ball app icon in the latest update by Ivan Jenic Image: Spotify Spotify has just released an update that removes its now infamous disco ball icon. The update reverts the app icon to the familiar flat green logo after weeks of mixed reactions online. The icon arrived on May 13 as part of the company's 20th anniversary celebration and was always intended to be temporary, though Spotify only confirmed that after the backlash started. The disco ball took the internet by storm, as the reception was split. A vocal group of users called it ugly and disorienting, with some iOS users noting that the 3D glowing effect made the app look like it was stuck mid-update. On the other end, the icon picked up a following of its own. Its retro, three-dimensional look immediately stood out against the flat, minimalist aesthetic that has dominated app design for years. It even started a small movement, spawning what people started calling "discomorphism," a mashup of disco and skeuomorphism. Other brands started posting disco ball versions of their own logos, probably in an effort to ride the wave of memes that flooded the internet during late May. Spotify has had a turbulent relationship with its user base lately. Besides the disco ball icon, which certainly wasn't appreciated by everyone, the company has also received backlash for its willingness to include AI-generated music on its platform. On May 17, Spotify promised the old icon would return “in a few weeks.” And now it looks like that time has finally arrived. So, whether you liked the disco ball or it made you uncomfortable, it’s now gone for good. The next time you update the Spotify app on your phone, the old, flat-design icon will return.
  • Recent Achievements

    • One Year In
      slackerzz earned a badge
      One Year In
    • One Year In
      highriskpaym earned a badge
      One Year In
    • One Month Later
      highriskpaym earned a badge
      One Month Later
    • Week One Done
      highriskpaym earned a badge
      Week One Done
    • Week One Done
      FBSPL earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      519
    2. 2
      PsYcHoKiLLa
      197
    3. 3
      +Edouard
      157
    4. 4
      Steven P.
      84
    5. 5
      ATLien_0
      75
  • Tell a friend

    Love Neowin? Tell a friend!