473,659 Members | 2,985 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DOCTYPE declaration on intranet sites.

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?

May 19 '06 #1
29 2938
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

May 19 '06 #2
VK

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


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.

May 19 '06 #3
>> 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...!

May 19 '06 #4
> 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.


Ok, so the "http://www.w3.org/TR/html4/strict.dtd" section of the
doctype declaration isn't critical if I'm not using a validator.

I think I get it... Thanks.

May 19 '06 #5
VK

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


Ok, so the "http://www.w3.org/TR/html4/strict.dtd" section of the
doctype declaration isn't critical if I'm not using a validator.

I think I get it... Thanks.


The URL section isn't crutial in any case and it doesn't make the
document valid/invalid.

If you have only <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> it
is still valid HTML 4.01 Strict - check on validator.w3.or g.

The only fine details is that Internet Explorer 6.0 or higher uses
DOCTYPE opaque strings to choose the rendering box model: by W3C or by
Microsoft. It has nothing to do with any of documented DOCTYPE
functionalities , they've just chosen this formal sign by themselves.

In this respect <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"> string leaves IE in the default box. At the same
time Transitional followed by a string containing substring
"http://www.w3" will switch IE into CSS1Compat mode. Of course you
shouldn't transform it into complete joke and you should use in such
case the proper URL - thus it's functionally irrelevant:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html401/loose.dtd">

HTML Strict always switch IE into CSS1Compar mode either in full or
short form, so nothing to worry about.

May 19 '06 #6
VK
thus it's functionally irrelevant
^^^^

despite it's functionally irrelevant

May 19 '06 #7
> If you have only <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
it is still valid HTML 4.01 Strict


Thanks.
I read in another post that the doctype declaration is case sensitive
so:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
is different to
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">

Is this correct?
Which version should I be using?

May 19 '06 #8
VK

AndyZa wrote:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
is different to
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">

Is this correct?
Which version should I be using?


Practical answer (the one to follow):
Use the version recommended by W3C
<http://www.w3.org/QA/2002/04/valid-dtd-list.html> because UA's
producers used these values for their internal regexp routines.
Theoretical answer (the one to /skip/ on, just out of curiosity):
As the immediate part after <!DOCTYPE supposes to point to the root
element in the document, it has to match the case of your root element.
Thus if you have:
<html>
....
</html>

then it should be <!DOCTYPE html...

and if you have
<HTML>
....
</HTML>

then it should be <!DOCTYPE HTML...

But this again a pure theory, as DTD's in HTML/XHTML have nothing in
common with DTD's in XML (except formal syntax).

May 19 '06 #9
> Thus if you have:
<html>
...
</html>

then it should be <!DOCTYPE html...


Ok. Since my html tags are in lowercase I'll go with <!DOCTYPE html...

Thanks

May 19 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2694
by: Ken Larson | last post by:
I have a question about using XSL to extract information from an SVG (XML) file that has a DOCTYPE/DTD declaration. I am able to do this successfully if I write my own SVG files without such a declaration. However, I would like to extract some parts of an SVG file exported by illustrator. When I try this, my XSL file is no longer able to access the nodes in the SVG document properly - somehow related to the DOCTYPE/DTD declaration. ...
13
4209
by: CJM | last post by:
I am building several (common) db-driven intranet sites (so I cant post URL), using a 3-frame layout; header, menu & main pages. The styling and some of the positioning is done via CSS. Up until yesterday, I had incomplete Doctypes in my pages: <!doctype html public "-//w3c//dtd html 4.01 transitional//en"> But now I have the full/correct doctype for 4.01 transitional:
7
2800
by: David Ross | last post by:
I manually code my HTML without using any page generating software. I need to know how to specify the DOCTYPE at the beginning of my HTML files. No, I don't want a "canned" DOCTYPE statement. I want to understand what the different fields mean so that I can tailor them to what I am really doing. --
14
2631
by: Mary Ellen Curtin | last post by:
(bad developer! no biscuit!) Hello gang, I'm a newbie here and to CSS, though I've been hacking around in HTML for a bit. One of the ways I've been learning CSS is by wending through AListApart. Looking through their back issues, I read http://alistapart.com/stories/msn/ Hakon Wium Lie, "MSN, Opera, and Web Standards" -- which, among other points, rightly castigated MSN for booting Opera
2
14796
by: DartmanX | last post by:
I doubt this is possible, but I want to ask, just in case it is. I have a project going using Google Maps. This project spits out an HTML page template for people to post to their website and display a map. Most of the people doing this will have limited knowledge of HTML. I want to ensure that this page remains an XHTML 1.0 Transitional (or Strict) page, in case some newbie removes the DOCTYPE or some slightly more knowledgeable tries...
25
2713
by: Viken Karaguesian | last post by:
Hello all, I'm somewhat of a newbie to webscripting. I've made a couple of websites in the past with WYSIWYG software, but now I'm much more interested in manual scripting. I have some questions about DOCTYPE: 1. Is a doctype statement *required*, or is it just "strongly suggested"? I would probably be using a Transitional doctype. 2. I understand that in a frameset I must use a Framset Doctype ststement,
17
2105
by: Rick Brandt | last post by:
We are using a JS popup calendar in our pages and find that we get various JS errors whenever we call the code from an HTML page that includes a DOCTYPE. The specific type doesn't seem to matter. As long as there is no DOCTYPE then everything works fine (IE and FF). I don't have the specific script or errors handy, but I was wondering if there are some general things I can look for. Is the JS page just using some deprecated methods...
6
7842
by: Rolf Welskes | last post by:
Hello, if I have for example: <table style="width: 100%; height: 100%;" border="1"> <tr> <td style="width: 100px">k </td> <td style="width: 100px">k </td> </tr>
20
1759
by: Deborah | last post by:
I'm trying to clean up my website, and it's in pretty good shape now, but I've gotten confused reading about Doctypes. My site is http://www.simi-therapy.com and my CSS is http://www.simi-therapy.com/simitherapy-screen.css . My pages all start with <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8335
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8528
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8627
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1976
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.