Validator(4.01 strict)不喜欢我的meta标签 [英] Validator (4.01 strict) doesn't like my meta tags

查看:93
本文介绍了Validator(4.01 strict)不喜欢我的meta标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




W3C验证器告诉我这个页面无效HTML 4.01严格:

http://www-student.cs.york.ac.uk/~jb .. ._validate.html


它给出的原因是我已经用''/''

封闭元标记("这里不允许使用字符数据)


例如


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

如果我删除''/''验证器不再抱怨。


那怎么样''/'在img

标签的末尾允许'字符*?


例如


< img高度= QUOT 31 QUOT;宽度= QUOT; 88" alt =" Valid CSS!" SRC ="有效-css.png" />

这是验证器中的错误,还是DTD中的不一致,或者我是不是傻瓜?


谢谢,


Barney

顺便说一句,如果你查看wont_validate.html页面的来源和

认为它看起来很可怕,我同意。该页面是由WASH生成的,这是一种嵌入式

语言Haskell。 WASH应该保证基本有效性。

Hi,

The W3C validator tells me this page isn''t valid HTML 4.01 Strict:

http://www-student.cs.york.ac.uk/~jb..._validate.html

The reason it gives is I''ve closed meta tags with a ''/''
("character data is not allowed here")

e.g.

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
If I remove the ''/'' the validator no longer complains.

How is it, then, that the ''/'' character *is* permitted at the end of an img
tag?

e.g.

<img height="31" width="88" alt="Valid CSS!" src="valid-css.png" />
Is this a bug in the validator, or an inconsistency in the DTD, or am I
being stupid?

Thanks,

Barney
By the way, if you look at the source for the wont_validate.html page and
think it looks horrid, I agree. The page was generated by WASH, an Embedded
Domain Specific Language which sits on top of the functional programming
language Haskell. WASH is supposed to guarantee elementary validity.

推荐答案

Barney Norris写道:
Barney Norris wrote:

W3C验证器告诉我这个页面无效HTML 4.01严格:

http://www-student.cs.york.ac.uk/~jb..._validate.html

原因它给出的是我已经关闭的元标记带有''/''(此处不允许使用字符数据)

< meta http-equiv ="内容型" content =" text / html;
charset = ISO-8859-1" />

如果我删除''/''验证器不再抱怨。


斜线不应该在那里。这是在xhtml中使用的,但你的

文件是html。

那么,最后允许''/''字符*是什么?一个img标签?


IIRC,斜线实际上关闭了元素,因此下一个字符

应该被视为数据,尽管没有浏览器实际上这样做。如果

我错了,很快就会有人告诉我。我从来没有玩过使用xhtml的b $ b,坦率地说没有理由,所以我从来没有真正看过语法上的差异。 />
那么,如果你看一下wont_validate.html
页面的来源并认为它看起来很可怕,我同意。

The W3C validator tells me this page isn''t valid HTML 4.01 Strict:

http://www-student.cs.york.ac.uk/~jb..._validate.html

The reason it gives is I''ve closed meta tags with a ''/'' ("character
data is not allowed here")

<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1" />

If I remove the ''/'' the validator no longer complains.
That slash shouldn''t be there. That is used in xhtml, but your
document is html.
How is it, then, that the ''/'' character *is* permitted at the end
of an img tag?
IIRC, the slash actually closes the element, so the next character
should be considered data, although no browsers actually do that. If
I''m wrong, someone will be along shortly to tell me. I''ve never
played with xhtml, and frankly don''t see a reason to, so I''ve never
really looked at syntactical differences.
By the way, if you look at the source for the wont_validate.html
page and think it looks horrid, I agree.




我不觉得它看起来很可怕。它看起来相当合理,特别是与所谓的网络创作工具生成的大多数页面相比,价格为b $ b。


-

Brian

按照我地址中的说明给我发电子邮件



I don''t think it looks horrid. It looks quite reasonable, especially
compared to most pages generated by so-called wysiwy web authoring tools.

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


" Barney Norris" <我们**** @ narney.net>写道:
"Barney Norris" <us****@narney.net> wrote:
W3C验证器告诉我这个页面无效HTML 4.01严格:

http://www-student.cs.york.ac.uk/~jb..._validate。 HTML

它给出的原因是我已经关闭了带有'/''
的元标记(此处不允许使用字符数据)

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


这是无效的HTML但有效的XHTML。删除斜杠或

将文档更改为XHTML。

那么,如果'/''字符*在*结尾处被允许的话怎么样? img
标签?

< img height =" 31"宽度= QUOT; 88" alt =" Valid CSS!" SRC ="有效-css.png" />
The W3C validator tells me this page isn''t valid HTML 4.01 Strict:

http://www-student.cs.york.ac.uk/~jb..._validate.html

The reason it gives is I''ve closed meta tags with a ''/''
("character data is not allowed here")

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
That is invalid HTML but valid XHTML. Either remove the slash or
change the document to XHTML.
How is it, then, that the ''/'' character *is* permitted at the end of an img
tag?

<img height="31" width="88" alt="Valid CSS!" src="valid-css.png" />




根据SGML规则代码,例如< img />或者< meta />实际上是< img>< / img>>的简短

形式或< meta>< / meta>>。注意额外的>最后。

在< head>中页面的一部分>不允许(此处不允许使用字符

数据),但在< body>中>部分被视为

部分内容。


浏览器几乎普遍存在错误,并且从未显示>

这是为什么你可以使用< img />配方将XHTML作为

HTML传递给毫无戒心的浏览器。


Steve


-

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

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


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



Under SGML rules code such as <img /> or <meta /> is actually a short
form of <img></img>> or <meta></meta>>. Note the extra > at the end.
In the <head> section of the page that > is not permitted ("character
data not allowed here") but in <body> section that > is treated as
part of the content.

Browsers almost universally get this wrong and never display the >
which is why you can use the <img /> formulation to pass XHTML off as
HTML to unsuspecting browsers.

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/>


感谢您的回复。


Brian写道.. 。
Thanks for your reply.

Brian wrote...
那条斜线不应该在那里。这是在xhtml中使用的,但是你的
文件是html。
That slash shouldn''t be there. That is used in xhtml, but your
document is html.




我理解它是一个XHTML的东西,但推理它必须被允许在

HTML 4,因为WASH将其生成为HTML 4输出(包括DOCTYPE)。它是
必须是WASH库的问题。



I understood it to be an XHTML thing, but reasoned it must be permitted in
HTML 4 since WASH produced it as HTML 4 output (the DOCTYPE included). It
must be a problem with the WASH library.

顺便说一下,如果你看一下源码wont_validate.html
页面并认为它看起来很可怕,我同意。
By the way, if you look at the source for the wont_validate.html
page and think it looks horrid, I agree.



我认为它看起来很可怕。它看起来很合理,特别是与大多数由所谓的网络创作工具生成的页面相比。



I don''t think it looks horrid. It looks quite reasonable, especially
compared to most pages generated by so-called wysiwy web authoring tools.




我知道你并不是在暗示你的想法WASH是一种WYSIWYG网络创作工具。

但是我很想向人们展示它不是。如果您有兴趣了解EDSL的样子,那么可以在这里找到

wont_validate页面(WASH库的额外内容)的Haskell源代码。

http:// www -student.cs.york.ac.uk/~jban100/procLinks2.hs


(Haskell脚本构建有问题的页面,同时生成
链接来自一个简单的文本文件。)


我想我可能会转而使用WASH生成XHTML标记。 WASH

可以为XHTML的有效性提供比HTML更强的保证。无论如何,

加价实际上非常接近有效的XHTML 1.1。


-

Barney



I know you''re not implying you think WASH is a WYSIWYG web authoring tool.
But I''m keen to show people it''s not. The Haskell source code for the
wont_validate page (extra to the WASH library) is available here if you''re
interested to know what the EDSL looks like.

http://www-student.cs.york.ac.uk/~jban100/procLinks2.hs

(The Haskell script builds the page in question, also generating the list of
links from a simple text file.)

I think I will probably switch to producing XHTML mark-up with WASH. WASH
can give stronger guarantees for validity with XHTML than with HTML. The
mark-up as it stands is actually very close to being valid XHTML 1.1 anyway.

--
Barney


这篇关于Validator(4.01 strict)不喜欢我的meta标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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