IE无法找到W3C XHTML DTD(错误2146697204) [英] IE cannot find the W3C XHTML DTD (Error 2146697204)

查看:153
本文介绍了IE无法找到W3C XHTML DTD(错误2146697204)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个模板,可以像这样开始每一页:

 <?xml version =1.0encoding = UTF-8\" >?; 
<! - blah blah - >
<!DOCTYPE html PUBLIC - // W3C // DTD XHTML 1.0 Transitional // ENhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>
< html xmlns =http://www.w3.org/1999/xhtml>
...
< / html>

产生错误:


无法显示XML页面
无法使用样式
工作表查看XML输入。请更正错误并按
然后单击刷新按钮,或稍后再次尝试






服务器不理解
请求,或者请求无效。
处理资源时出错
' http://www.w3.org/TR/ IE上的xhtm ...


因为 W3C已停止提供DTD



什么是正确的方法解决这个问题?

解决方案

可能的解决方案



我上传了两个文件你可以看到它的实际效果:


  1. 作为HTML文件:试一试,标题是 text / html

  2. 作为XML文件试一试,标题是 text / html

第一个将起作用在所有浏览器中。第二个将在IE中失败(并在其他工作),因为它忽略了服务器的标头。原因是: * .xml 文件名部分的结尾。这是IE的错误行为,但我们必须处理它。如果您的文件名以xml结尾或您的服务器通过application / xml发送,则更改这些设置。



背景



您引用的资源标识符不是资源标识符。它是一个唯一的标识符,可以说是一个占位符。在提供HTML的情况下,它从未打算下载(无论在这种情况下是否为XHTML)。这是行为不端的IE。



您引用的帖子暗示他们可能使资源脱机。 DTD仍然在线 即可。对于其他标准,他们使用不同的方法,其中资源不在与标识符相同的位置上在线(人们对命名空间的问题相同:它是资源,它是标识符)。 / p>

这不是XML恐怖,而只是IE表现得很奇怪。要使用IE和XHTML,您必须将其作为MIME类型以 text / xml 的形式提供。如果在本地运行它,则可能会出现此错误。尝试以不同的方式提供服务。



注意:之后你会问:XML规范规定不应下载DTD,但应该看到作为一个独特的身份。仅用于验证XML下载资源是好的,但标准说资源ID和实际资源不需要相同。


I have a template that starts every page like this:

<?xml version="1.0" encoding="utf-8"?>
<!-- blah blah-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml">
...
</html>

that produces the error:

The XML page cannot be displayed Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.


The server did not understand the request, or the request was invalid. Error processing resource 'http://www.w3.org/TR/xhtm...

on IE because W3C has stopped serving the DTD.

What is the proper way to fix this?

解决方案

Possible Solution

I uploaded two files for you to see it in action:

  1. As HTML file: try it out, headers are text/html.
  2. As XML file try it out, headers are text/html.

the first will work in all browsers. The second will fail in IE (and work in others) because it ignores the headers of the server. The reason: the *.xml ending of the filename part. This is wrong behavior of IE, but we'll have to deal with it. If your filename ends on xml or your server sends it through as application/xml then change these settings.

Background

The resource identifier that you refer to is not a resource identifier. It is a unique identifier, a placeholder so to speak. It was never meant for being downloaded in cases of HTML being served (regardless it being XHTML as in this case). This is misbehaving IE.

The post you refer to suggests that they might take the resource offline. The DTD is still online. With other standards, they used different approaches, where the resource is not online on the same location as the identifier (same issue people have with namespaces: it is not a resource, it is an identifier).

This is not XML horror, but simply IE behaving oddly. To work with IE and XHTML, you must serve it as text/xml as MIME type. If you run it locally, you can get this error. Try to serve it differently.

NOTE: before you ask: the XML specification states that the DTD should not be downloaded, but should be seen as a unique id. Only for validating XML downloading the resource is good, but the standard says that the resource ID and the actual resource do not need to be same.

这篇关于IE无法找到W3C XHTML DTD(错误2146697204)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆