内容类型不是保留名称? [英] Content-Type not a reserved name?

查看:74
本文介绍了内容类型不是保留名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试验证以以下内容开头的页面:

<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 Transitional // EN"

" http://www.w3.org/TR/html4/loose.did>


< html>

< head>

< meta http-equiv =" Content-Type"含量=" text / html的;字符集= ISO-8859-1" />

....

在此行中失败:


" CONTENT-TYPE"不是保留的名字


任何人都可以帮助我吗? TIA。


D.


Dennis M. Straussfogel,Ph.D。

航空航天工程顾问


I''m trying to validate a page that begins with:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.did>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
....
which fails at this line with:

"CONTENT-TYPE" is not a reserved name

Can anyone help me? TIA.

D.

Dennis M. Straussfogel, Ph.D.
Aerospace Engineering Consultant

推荐答案

Dennis M. Straussfogel写道:
Dennis M. Straussfogel wrote:
我正在尝试验证以以下内容开头的页面:

<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 Transitional // EN"
" http://www.w3.org/TR/html4/loose.did>


a typo:loose.dtd(not loose.did)

< html>
< head>
< meta HTTP的当量= QUOT;内容类型"含量=" text / html的;字符集= ISO-8859-1" />
I''m trying to validate a page that begins with:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.did>
a typo: loose.dtd (not loose.did)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />




语法错误。你不应该有/>最后('xhtml

语法,但你的文件是html)。更重要的是,您应该使用真正的http标头设置内容类型和字符集的

。搜索

Google制作了以下由Alan Flavell撰写的文档:

http://ppewww.ph.gla.ac.uk/~flavell/...t/ns-burp.html


-

Brian

按照我的地址指示给我发电子邮件



The syntax is wrong. You should not have /> at the end (that'' xhtml
syntax, but your document is html). More importantly, you should set
the content type and charset using real http headers. A search on
Google produced the following document authored by Alan Flavell:

http://ppewww.ph.gla.ac.uk/~flavell/...t/ns-burp.html

--
Brian
follow the directions in my address to email me


dm*@bcgroup.net (Dennis M. Straussfogel)写道:
dm*@bcgroup.net (Dennis M. Straussfogel) wrote:
我正在尝试验证以以下内容开头的页面:

<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 Transitional // EN"
" ;http://www.w3.org/TR/html4/loose.did>

< html>
< head>
< meta http -equiv = QUOT;内容类型"含量=" text / html的;字符集= ISO-8859-1" />

在这一行失败了:

" CONTENT-TYPE"不是保留名称
I''m trying to validate a page that begins with:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.did>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

which fails at this line with:

"CONTENT-TYPE" is not a reserved name




你错过了一个在doctype的URL末尾。因此,

验证器看到如下内容:


<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 Transitional // EN"

" long string"的Content-Type"含量=" text / html的;字符集= ISO-8859-1" />


下一个问题是XHTML< meta />在HTML文档中。从来没有

使用HTML中的最后一个/空元素,只能使用XHTML。


Steve


-

我的理论给你起见,我的异端邪说你愤怒,

我从不回信,你不喜欢我的领带。 - 医生


Steve Pugh< st *** @ pugh.net> < http://steve.pugh.net/>



You''re missing a " at the end of the URL in the doctype. Hence the
validator sees something like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"long string" Content-Type" content="text/html; charset=iso-8859-1" />

The next problem will be the XHTML <meta /> in an HTML document. Never
use that last / in empty elements in HTML, only in XHTML.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don''t like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>


在文章< dm **************** **@news.abccom.bc.ca> ;,无限猴子之一
dm*@bcgroup.net <键盘上的
/ a>(Dennis M. Straussfogel)写道:
In article <dm******************@news.abccom.bc.ca>, one of infinite monkeys
at the keyboard of dm*@bcgroup.net (Dennis M. Straussfogel) wrote:
< meta http-equiv =" Content-Type"含量=" text / html的;字符集= ISO-8859-1" />

在这一行失败了:

" CONTENT-TYPE"不是保留名称
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

which fails at this line with:

"CONTENT-TYPE" is not a reserved name




嗯?无论什么工具都报告为失败。正在胡说八道。


但Brian的跟进会提出一些你应该注意的有效点。


-

Nick Kew



Huh? Whatever tool reported that as a "fail" is talking nonsense.

But Brian''s followup makes some valid points you should note.

--
Nick Kew


这篇关于内容类型不是保留名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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