Intranet站点上的DOCTYPE声明。 [英] DOCTYPE declaration on intranet sites.

查看:86
本文介绍了Intranet站点上的DOCTYPE声明。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据w3c规范,如果缺少DOCTYPE

声明,则网页无效。因此,如果我将以下doctype添加到我的页面

,它们将是合规的:


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

" http://www.w3.org/TR/html4/strict.dtd">


但是这与INTRANET网站有关,用户可能没有

INTERNET访问权限?页面如何通过
http://进行验证www.w3.org/TR/html4/strict.dtd DTD如果用户没有

互联网接入?如果浏览器无法连接到

www.w3.org 存储.dtd文档的网站?

验证是否失败?


我应该将.dtd文件复制到我的Intranet服务器上并更改

doctype类似于:


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

" http: //myintranet/strict.dtd">


或者我应该完全省略内联网的doctype声明

页面?

According to the w3c specs a web page is not valid if the DOCTYPE
declaration is missing. So, if I add the following doctype to my pages
they will be "compliant":

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

But is this relevant to INTRANET sites where users might not have
INTERNET access? How does the page get validated against the
http://www.w3.org/TR/html4/strict.dtd DTD if the users don''t have
internet access? What happens if the browser is unable to connect to
the www.w3.org site where the .dtd document is stored? Does the
validation "fail"?

Should I copy the .dtd file onto my intranet server and change the
doctype to something like:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://myintranet/strict.dtd">

Or should I leave out the doctype declaration completely for intranet
pages?

推荐答案

AndyZa写道:
根据w3c规范,如果缺少DOCTYPE
声明,网页无效。因此,如果我将以下doctype添加到我的页面中
它们将是合规的:

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

但这与用户可能没有的INTRANET网站相关/> INTERNET访问?


符合标准的HTML文档是一个兼容的HTML文档,无论发布它的是什么


如何验证页面反对
http://www.w3.org/ TR / html4 / strict.dtd DTD如果用户没有上网?


没有。除非您在Intranet上安装了验证器,例如,如果您要在发布过程中验证您的页面,则需要



如果浏览器无法连接到
存储.dtd文档的 www.w3.org 网站?


如果没有

互联网接入,为什么浏览器会尝试连接到网站?您的用户在做什么会导致浏览器尝试获取DTD?

验证是否失败?


什么验证?浏览器不验证HTML文档。

我应该将.dtd文件复制到我的Intranet服务器上并将
doctype更改为:

<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 // EN"
" http://myintranet/strict.dtd">


不,如果你的内部系统上有验证器那么它应该

有常用的PUBLIC DTD,例如存储在本地的HTML 4.01
目录。

或者我应该完全省略内联网
页面的doctype声明吗?
According to the w3c specs a web page is not valid if the DOCTYPE
declaration is missing. So, if I add the following doctype to my pages
they will be "compliant":

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

But is this relevant to INTRANET sites where users might not have
INTERNET access?
A compliant HTML document is a compliant HTML document regardless of
where it is published.
How does the page get validated against the
http://www.w3.org/TR/html4/strict.dtd DTD if the users don''t have
internet access?
It doesn''t. Unless you have a validator installed on the Intranet e.g.
if you are be validating your pages as part of the publication process.
What happens if the browser is unable to connect to
the www.w3.org site where the .dtd document is stored?
Why would the browser be trying to connect to a web site if there is no
Internet access? What are your users doing that will cause the browser
to try and fetch the DTD?
Does the validation "fail"?
What validation? Browsers do not validate HTML documents.
Should I copy the .dtd file onto my intranet server and change the
doctype to something like:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://myintranet/strict.dtd">
No, if you have a validator on your internal systems then it should
have commonly used PUBLIC DTDs such as HTML 4.01 stored in its local
catalogue.
Or should I leave out the doctype declaration completely for intranet
pages?




你呢希望你的页面符合规范吗?

或许更重要的是你想触发怪癖或标准

符合标准的渲染模式?这就是所有网络浏览器都使用doctype

声明。


Steve



Do you want your pages to be compliant with the specs or not?
Perhaps more importantly do you want to trigger the Quirks or Standards
Compliant rendering mode? That''s all that web browsers use the doctype
declaration for.

Steve



AndyZa写道:

AndyZa wrote:
根据w3c规范,如果缺少DOCTYPE
声明,则网页无效。因此,如果我将以下doctype添加到我的页面中
它们将是合规的:

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

但这与用户可能没有的INTRANET网站相关/> INTERNET访问?页面如何通过
http://进行验证www.w3.org/TR/html4/strict.dtd DTD如果用户没有上网?如果浏览器无法连接到 www.w3.org ,会发生什么情况存储.dtd文档的站点?
验证是否失败?
According to the w3c specs a web page is not valid if the DOCTYPE
declaration is missing. So, if I add the following doctype to my pages
they will be "compliant":

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

But is this relevant to INTRANET sites where users might not have
INTERNET access? How does the page get validated against the
http://www.w3.org/TR/html4/strict.dtd DTD if the users don''t have
internet access? What happens if the browser is unable to connect to
the www.w3.org site where the .dtd document is stored? Does the
validation "fail"?




HTML / XHTML中的DOCTYPE是一个不透明的字符串,用于匹配使用过的标签和

内部数据构建到浏览器中的属性(考虑名称空间

XML格式的声明)。没有人浏览器/检索/链接的DTD,因为它不应该在HTML页面中以这种方式使用.b $ b。还有一些浏览器

(比如说Firefox)根本无法检索外部DTD,即使他们出于某种原因需要




所有UA都能够通过完整形式

(带URL)或短格式(不带URL)匹配这些不透明字符串。所以不要混淆你的11个

与你可能只使用的伪URL问题<!DOCTYPE HTML PUBLIC

" - // W3C // DTD HTML 4.01 // EN" ;>

这是完全正确的,字符串仍然正常

匹配。



DOCTYPE in HTML/XHTML is an opaque string used to match used tags and
attributes against internal data build into browser (think of namespace
declarations in XML). No one browser /retrieve/ the linked DTD as it''s
not supposed to be used in such way in HTML pages. Also some browsers
(say Firefox) simply not capable to retrieve external DTD''s even if
they wanted to for some reason.

All UA''s are capable to match these opaque strings either by full form
(with URL) or by short form (without URL). So do not confuse yourselve
with pseudo-URL issues you may just use <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN">
That is perfectly correct and the string will be still properly
matched.


>>如何根据
>> How does the page get validated against the
http://www.w3.org/TR/html4/strict.dtd DTD如果用户没有上网功能?它不是。除非您在Intranet上安装了验证器,例如
如果您要在发布过程中验证您的页面。
http://www.w3.org/TR/html4/strict.dtd DTD if the users don''t have
internet access? It doesn''t. Unless you have a validator installed on the Intranet e.g.
if you are be validating your pages as part of the publication process.




Web浏览器是否忽略" doctype标签的url部分?



Does the web browser "ignore" the url part of the doctype tag?

或者我应该完全忽略内部网
页面的doctype声明吗?
Or should I leave out the doctype declaration completely for intranet
pages?


您希望您的页面符合规格吗?


Do you want your pages to be compliant with the specs or not?




是的!这就是我想要的全部!

也许更重要的是你想触发Quirks或Standards
Compliant渲染模式?这就是网页浏览器使用doctype
声明的所有内容。



YES! That''s ALL I want!
Perhaps more importantly do you want to trigger the Quirks or Standards
Compliant rendering mode? That''s all that web browsers use the doctype
declaration for.




Aaah!


所以,浏览器使用doctype声明所做的一切就是用它来实现Quake和标准兼容模式之间的
切换?这就是为什么

是否有必要在页面中包含doctype声明?那是

吗?


如果我使用验证器,它会使用在w3.org网址上找到的.dtd

进行验证的声明?


这是doctype标签中w3.org url的唯一目的吗?


是, 我知道!我糊涂了!点火......!



Aaah!

So, all that the browser does with the doctype declaration is use it to
switch between the Quirks and Standards Compliant mode? And that''s why
it''s necessary to include the doctype declaration in the page? Is that
it?

And if I use a validator it uses the .dtd found at the w3.org url in
the declaration to do that validation?

Is that that the only purpose for the w3.org url in the doctype tag?

Yes, I know! I''m confused! Flame on...!


这篇关于Intranet站点上的DOCTYPE声明。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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