How to force IE 7 to open XHTML files?

The application I'm creating is creating XHTML documents that will be distributed in a bunch of different ways, including email. I can open these documents in Firefox or Chrome (and by "open" I mean Windows Explorer, and not through a web server). However, with IE 7 I have two problems, maybe three different.

If the files are named with the extension ".xhtml", IE starts and then closes. Sometimes he still works in the task manager, and I have to kill him. Sometimes not.

If I call them the extension ".htm" or ".html", they open properly, with the exception of the IE information panel, which tells me that it has blocked some content. These documents do not contain any scripts or frames or objects - they may be similar to XHTML. They don’t even reference external CSS.

When the client I'm developing for this opens the documents in their environment (it just uses the extension “.xhtml” at the moment), IE opens them and displays them as XML documents.

I spent a lot of time on Google to try and figure this out, and all I find there is related to determining the MIME type in the HTTP header, which is not particularly useful, m does not actually serve these files.

( ) DOCTYPE, ; :

<?xml version="1.0" encoding="utf-8"?>
<!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">

?

+3
4

, . IE7 XHTML.

, XHTML application/xhtml+xml, ", XHTML, ", XML . , , XHTML text/html, , " HTML- , ".

- W3C, - IE , , XML- HTML. IE-only xsl:stylesheet XSLT HTML. ; IE , , , XML ( ), HTML. , .

, . , , , . , XML, . , , .

, .htm. . .htm text/html, .xhtml application/xhtml+xml. IE , , text/html, , . .

+5

IE XML.

. XHTML IE, .html.

, , , ?

".htm" ".html", , IE, , - .

. , IE , Mark Of The Web IE. XML, , .

<!-- saved from url=(0014)about:internet -->
<!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">

, CRLF ( , ), . .

+2

.html HKEY_CLASSES_ROOT Windows: , .xhtml.

< Standard disclaimer on how registry mess is dangerous >

0
source

You can try to save them as .html, but add a meta line in the header section, describing the content as HTMl, and not something active:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
0
source

Source: https://habr.com/ru/post/1702713/


All Articles