更严格的4.01严格的DTD [英] Stricter 4.01 Strict DTD

查看:75
本文介绍了更严格的4.01严格的DTD的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在考虑使用自定义的更严格的本地HTML 4.01

严格的DTD用于本地验证。这样我就不会改变我的doctype,我的文件仍然会坚持公众4.01

Strict DTD,但我会有额外的优势通过映射

本地验证器(ARV)到本地自定义DTD,我得到了

示例的未闭合段落标签示例。

这样做有任何不利之处,并且有人创造了这样一个b $ b更严格的 4.01严格的DTD?


-

Spartanicus

I''ve been thinking about using a custom "stricter" local HTML 4.01
Strict DTD for the purpose of local validation. That way I wouldn''t have
to change my doctype, my documents would still adhere to the public 4.01
Strict DTD, but I''d have the added advantage that I get warnings for
example for unclosed paragraph tags when validating locally by mapping
my local validator (ARV) to that local custom DTD.

Any disadvantages in doing that, and has anyone created such a
"stricter" 4.01 Strict DTD?

--
Spartanicus

推荐答案

Spartanicus< ; me@privacy.net>写道:
Spartanicus <me@privacy.net> wrote:
我一直在考虑使用自定义的更严格的本地HTML 4.01
严格的DTD用于本地验证。


实际上这就是我昨天所做的。我复制了严格的DTD,删除了

的评论,产生了 http://www.cs.tut.fi/~jkorpela/html/401.dtd

然后加快了一些变化:
< a rel =nofollowhref =http://www.cs.tut.fi/~jkorpela/html/my401.dtdtarget =_ blank> http://www.cs.tut.fi/~jkorpela /html/my401.dtd


嗯,我没有_only_使它更严格但是还添加了一些标签,需要

在某些情况下,由于

浏览器有一些无能为力的线路突破 - 它们部分地支持比使用Unicode线路破坏规则的无用部分更糟糕但是
/>
甚至不支持为覆盖它们而定义的控制字符。

这里是我做的简要文档:


* NOBR和WBR作为文本级别标记添加。

*定义%像素;作为NUMBER,而不是CDATA。

*为所有元素制作开始标记。

*但是直接在TABLE中允许TR,就像在XHTML中一样。

*为所有非EMPTY元素生成所需的结束标记。

* HTML需要LANG。


(因此,支持的相当普遍的论点需要的XHTML

使得结束标签是强制性的,这是不正确的。)


(如果有人想要使用这些文件,请复制它们而不是

通过URL引用它们。)

这样做的任何缺点,
I''ve been thinking about using a custom "stricter" local HTML 4.01
Strict DTD for the purpose of local validation.
Actually that''s what I did yesterday. I copied the Strict DTD, removed
the comments, producing http://www.cs.tut.fi/~jkorpela/html/401.dtd
and then souped up some changes:
http://www.cs.tut.fi/~jkorpela/html/my401.dtd

Well, I didn''t _only_ make it stricter but also added some tags that
are needed for decent line breaking control in some cases, since
browsers have _so_ clueless line breaking these days - they partly
support the worse than useless part of Unicode line breaking rules but
don''t even support the control characters defined for overriding them.
Here''s a brief documentation of what I did:

* NOBR and WBR added as text level markup.
* Define %Pixels; as NUMBER, not CDATA.
* Make start tags required for all elements.
* But allow TR directly inside TABLE, as in XHTML.
* Make end tags required for all non-EMPTY elements.
* Make LANG required for HTML.

(Thus, the fairly common argument in favor of XHTML that it is needed
for making end tags compulsory simply isn''t true.)

(If anyone wants to use those files, please copy them instead of
referring to them via URLs.)
Any disadvantages in doing that,




浏览器可能会惩罚你没有参加货运,即他们可能会转向怪癖模式。 (即故意错误

模式)如果你没有他们想要的拼写中的严格DTD。

你可能会忽略这个,如果你不使用HTML中的任何功能或(在CSS中可能更多的b $ b)在怪癖模式中受到伤害。或者你可能会欺骗

欺骗者:你可以在验证中使用你自己的DTD(本地或使用网上的验证器使用

)和文件中的神圣spelli <实际投放到网上的



-

Yucca, http://www.cs.tut.fi/~jkorpela/

有关的页面网页制作: http://www.cs.tut.fi/ ~jkorpela / www.html



Browsers may punish you for not participating in the cargo cult, i.e.
they may switch to "quirks mode" (that is, intentionally erroneous
mode) if you don''t have the Strict DTD in the spelling they want.
You might ignore this if you don''t use any features in HTML or (more
probably) in CSS that get hurt in "quirks mode". Or you might cheat
those who cheat: you could use your own DTD in validation (locally or
using the validators on the Web) and the sacred spelli in the documents
that you actually put onto the Web.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


文章< g0 **************** ****************@news.spartanic us.utvinternet.ie>,

Spartanicus< me@privacy.net>写道:
In article <g0********************************@news.spartanic us.utvinternet.ie>,
Spartanicus <me@privacy.net> writes:
我一直在考虑使用自定义的更严格的方法。本地HTML 4.01
严格的DTD用于本地验证。这样我就不会改变我的doctype,我的文件仍然会坚持公众4.01严格的DTD,但我会有额外的优势,我得到了警告
通过将本地验证器(ARV)映射到本地自定义DTD来本地验证时未封闭段落标记的示例。
I''ve been thinking about using a custom "stricter" local HTML 4.01
Strict DTD for the purpose of local validation. That way I wouldn''t have
to change my doctype, my documents would still adhere to the public 4.01
Strict DTD, but I''d have the added advantage that I get warnings for
example for unclosed paragraph tags when validating locally by mapping
my local validator (ARV) to that local custom DTD.




是的,人们有时会这样做。


但是有更好的方法来实现你的目标(假设你的验证器

基于OpenSP--正如所有已知的HTML验证器一样)。您可以使用OpenSP解析器为
设置选项,以便在运行时发出类似

未闭合标签的警告,而无需触及DTD。

这正是挑剔的原因。 Page Valet的模式 -

http:/ /valet.webthing.com/page/parsemode.html


-

Nick Kew



Yes, people sometimes do that.

But there''s a better way to accomplish your goal (assuming your validator
is based on OpenSP - as all the known HTML validators are). You can
set options with the OpenSP parser to issue warnings for things like
unclosed tags at runtime, without touching the DTD at all.
That''s exactly what the "fussy" mode of Page Valet does -
see http://valet.webthing.com/page/parsemode.html

--
Nick Kew


ni**@hugin.webthing.com (Nick Kew)写道:
ni**@hugin.webthing.com (Nick Kew) wrote:
但是有更好的方法来实现你的目标(假设你的验证器是基于OpenSP的 - 就像所有已知的HTML验证器一样)。您可以使用OpenSP解析器设置选项,以便在运行时发出
非闭合标记等警告,而无需触及DTD。
But there''s a better way to accomplish your goal (assuming your validator
is based on OpenSP - as all the known HTML validators are). You can
set options with the OpenSP parser to issue warnings for things like
unclosed tags at runtime, without touching the DTD at all.




我不认为ARV是可能的,它的配置文件映射

doctype'是本地DTD',仅此而已。

-

Spartanicus



I don''t think that''s possible with ARV, it''s configuration file maps
doctype''s to local DTD''s, nothing more.

--
Spartanicus


这篇关于更严格的4.01严格的DTD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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