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

    • I disagree; they come off very "bitchy" and "whiny". Make a great product and combine that with a great price (free) and people will come over to your side. Or build it and they will come as they say. Constantly trying to get attention by complaining all the time, will turn people off to your product.
    • It use to be a nightmare, with LibreOffice supporting a newer draft ODF standard by default, and Microsoft Office supporting the older non-draft standard. Now that they both support the same version of ODF, they should be interoperable.
    • Brave Browser 1.91.171 by Razvan Serea Brave Browser is a lightning-fast, secure web browser that stands out from the competition with its focus on privacy, security, and speed. With features like HTTPS Everywhere and built-in tracker blocking, Brave keeps your online activities safe from prying eyes. Brave is one of the safest browsers on the market today. It blocks third-party data storage. It protects from browser fingerprinting. And it does all this by default. Speed - Brave is built on Chromium, the same technology that powers Google Chrome, and is optimized for speed, providing a fast and responsive browsing experience. Brave Browser also features Brave Rewards, a system that rewards users with Basic Attention Tokens (BAT) for viewing opt-in ads. This innovative system provides an alternative revenue model for content creators and a way to support the Brave community. SlimBrave Neo takes all the good things about Brave and makes them even better by keeping everything clean, light, and privacy-focused. It removes the extra clutter, turns off features you might not need, and cuts down on anything that could slow you down or collect unnecessary data. Because it relies on simple settings and policies instead of modifying the browser itself, you still get full Brave compatibility—just in a smoother, lighter, and more privacy-friendly package. Brave Browser 1.91.171 changelog: General Fixed Cardano not being disabled on upgrade to Brave Origin. Upgraded Chromium to 149.0.7827.103. Origin Removed “Survey Panelist” setting from brave://settings/privacy. Fixed P3A and usage ping under brave://settings/privacy being displayed on first launch on Linux. Upgraded Chromium to 149.0.7827.103. Download: Brave Browser 64-bit | 1.2 MB (Freeware) Download: Brave Browser 32-bit View: Brave Homepage | Offline Installers | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Hi. As the title suggests, I can't access the forum on my phone. I'm using Edge on Android and when I try to navigate to the forum I get a "we value your privacy" popup and none of the buttons are clickable. It effectively stonewalls me from reading any forum content.
    • Honestly you're not wrong about AdGuard. Neowin frequently has lifetime license discounts for them and that's how I got my cheap family license a few years ago to run it on all my devices.
  • Recent Achievements

    • Rookie
      Marzoid went up a rank
      Rookie
    • Community Regular
      coch went up a rank
      Community Regular
    • 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
  • Popular Contributors

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

    Love Neowin? Tell a friend!