Click here to get back home

DOCTYPE declaration on intranet sites.

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
DOCTYPE declaration on intranet sites. AndyZa 05-19-2006
Get Chitika Premium
Posted by AndyZa on May 19, 2006, 5:09 am
Please log in for more thread options


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?


Posted by Steve Pugh on May 19, 2006, 5:22 am
Please log in for more thread options


AndyZa wrote:
> 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?

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


Posted by AndyZa on May 19, 2006, 6:27 am
Please log in for more thread options


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

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

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

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!

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...!


Posted by Michael Winter on May 19, 2006, 8:04 am
Please log in for more thread options


On 19/05/2006 11:27, AndyZa wrote:

[snip]

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

Yes and no. As far as using it to obtain the DTD, no. As Steve wrote,
browsers neither retrieve the DTD nor validate documents[1]. That said,
browsers do use the system identifier (the URI) when deciding whether to
trigger 'Quirks' or 'Standards' mode (DOCTYPE switching).

Briefly, a Strict document type will always trigger Standards mode. A
Transitional or Frameset document type will only do so if the URI is
also present. The rules are more complicated than that, but if you stick
to Strict HTML 4.01, you can safely ignore it all.

[snip]

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

Yes.

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

Yes.

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

Pretty much. A validator can use the public identifier (the quoted
string after PUBLIC) to determine how to validate a document if it
recognises it (and a common DTD like HTML 4.01 Strict, will be known).
If not, it'll fall back to the URI.

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

You don't seem to be. A little nudge in the right direction, perhaps. :-)

Mike


[1] That's not to say that a browser /couldn't/ perform
validation, but still, they don't. It wouldn't be very
practical anyway when one considers how much broken (not just
bad) markup there is on the Web.

--
Michael Winter
Prefix subject with [News] before replying by e-mail.

Posted by Harlan Messinger on May 19, 2006, 9:54 am
Please log in for more thread options


Michael Winter wrote:
> On 19/05/2006 11:27, AndyZa wrote:
>
> [snip]
>
>> Does the web browser "ignore" the url part of the doctype tag?
>
> Yes and no. As far as using it to obtain the DTD, no. As Steve wrote,
> browsers neither retrieve the DTD nor validate documents[1]. That said,
> browsers do use the system identifier (the URI) when deciding whether to
> trigger 'Quirks' or 'Standards' mode (DOCTYPE switching).
>
> Briefly, a Strict document type will always trigger Standards mode. A
> Transitional or Frameset document type will only do so if the URI is
> also present.

*The* URI or *any* URI? In other words, if I were to put the URI of a
local copy of the DTD on an intranet and point the docytype declaration
to that, would the browser use standards mode because *a* URI is there,
it would it use quirks mode because the "wrong" URI is there?

Similar ThreadsPosted
Overriding CSS Declaration for Different Use March 30, 2008, 4:50 pm
W3C Validator (CSS, XHTML) for intranet websites: which options are available? January 13, 2008, 1:15 pm
hotmail password request tool (intranet usage) April 18, 2005, 6:12 am
How to validate with W3C validation for intrAnet apps. (behind a firewall+proxy) January 24, 2008, 5:52 pm
Multiple html page viewer for a group intranet site October 20, 2004, 5:57 am
Last rites declaration of Ioannes Paulus PP. II (Karol Wojtyla) May 2, 2005, 2:23 am
Need help changing anchor text color in this style declaration April 19, 2006, 11:28 am
GIMP for Web sites July 22, 2004, 8:28 am
free template sites? November 15, 2004, 6:56 pm
Triple AAA compliance? 34,000 sites seem to think so. July 29, 2006, 2:45 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap