且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

内容类型不是保留名称?

更新时间:2023-11-18 21:29:28

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;内容类型&QUOT;含量=&QUOT; text / html的;字符集= ISO-8859-1&QUOT; />
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"
&quot ;http://www.w3.org/TR/html4/loose.did>

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

在这一行失败了:

" 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&QUOT;含量=&QUOT; text / html的;字符集= ISO-8859-1&QUOT; />


下一个问题是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&gt ;,无限猴子之一
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"含量=&QUOT; text / html的;字符集= ISO-8859-1&QUOT; />

在这一行失败了:

" 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