473,396 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Doctype quickie!

CJM
Are DOCTYPE statements case sensitive?

I cant remember where, but I'm sure I read that case *does* matter...

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

....will work [ie trigger 'Standards mode'], but...

<!doctype html public "-//w3c//dtd html 4.01//en"
"http://www.w3.org/tr/html4/strict.dtd>

...won't.

Cheers

Chris
Jul 20 '05 #1
4 1758
"CJM" <cj*****@yahoo.co.uk> wrote:
Are DOCTYPE statements case sensitive?
Parts of them are...

The root element (i.e. the HTML) is case senstive in so far as the
root element itself might be case sensitive. i.e. in XHTML the root
element must be html because all element names in XHTML are lower
case; but in HTML it makes no difference.

The Formal Public Identifier (the part in quotes) is also case
sensitive.

If you include the URL then that's as case sensitive or insensitive as
any other URL.

As far as I'm aware the rest is not case sensitive.
I cant remember where, but I'm sure I read that case *does* matter...

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

...will work [ie trigger 'Standards mode'], but...

<!doctype html public "-//w3c//dtd html 4.01//en"
"http://www.w3.org/tr/html4/strict.dtd>

..won't.


That second one is wrong as the FPI should be uppercase as in the
first example.

Doctype sniffing is another matter as their we're dealing with
browsers and their peculiarities rather than SGML/XML rules.

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/>
Jul 20 '05 #2
"CJM" <cj*****@yahoo.co.uk> wrote:
Are DOCTYPE statements case sensitive?
The part that is in quotation marks is case sensitive. The rest isn't.
I cant remember where, but I'm sure I read that case *does* matter...
Well, I'm afraid the HTML specification doesn't tell you this, and various
tutorials are even less informative. In principle, you are supposed to know
this from SGML.
eg.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd>
There's a missing quotation mark near the end. Otherwise, the incantation is
correct.
...will work [ie trigger 'Standards mode'], but...
Umm... will be mishandled by browsers, which abuse it and make (wrong)
guesses on author's intentions, completely missing the point of document
type definitions.

If they take SGML seriously, they do that just by accident, so what is
_right_ by international standards is of little consequence here. But
apparently wowsers accidentally treat the quoted strings as case sensitive -
probably just because it's a little easier, or because nobody gave the issue
a thought.
<!doctype html public "-//w3c//dtd html 4.01//en"
"http://www.w3.org/tr/html4/strict.dtd>

..won't.


It is malformed, since there is no catalogued DTD under the name
"-//w3c//dtd html 4.01//en".

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

Jul 20 '05 #3
CJM
Thanks for that...

The problem is made worse for me because I'm developing in VS.NET; it has a
hand feature, which asks you whether you want HTML tags and attributes in
Uppercase/Lowercase/As Typed - I chose Lowercase to be forward-looking to
XHTML.

Unfortunately when I cut & paste my DOCTYPEs, it renders it ALL as
lowercase...which made for a bit of head-scratching when my pages were
render in an unexpected way!

Cheers

CJM
Jul 20 '05 #4
CJM wrote:
Thanks for that...

The problem is made worse for me because I'm developing in VS.NET; it has a
hand feature, which asks you whether you want HTML tags and attributes in
Uppercase/Lowercase/As Typed - I chose Lowercase to be forward-looking to
XHTML.
Are empty tags also rendered correctly: <br/>? Otherwise it doesn't make
much sense I think.
Unfortunately when I cut & paste my DOCTYPEs, it renders it ALL as
lowercase...which made for a bit of head-scratching when my pages were
render in an unexpected way!
E-mail the developers of that programm. The only thing I know about it,
is that it comes from MS, but maybe there is some option to add that
doctype later?
Cheers

CJM

--
Anne van Kesteren
<http://www.annevankesteren.nl/>
Jul 20 '05 #5

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

Similar topics

13
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...
6
by: Patrick | last post by:
Hi I am fairly new to CSS and the web.I am trying to build a site more to practice my skills than for the site itself. I have been focusing on CSS and try my best to make it work in I.E 6.0,...
2
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...
25
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...
7
by: Robin Haswell | last post by:
Hey guys. This should just be a quickie: I can't figure out how to convert r"\x2019" to an int - could someone give me a hand please? Cheers -Rob
24
by: Jim Michaels | last post by:
I can't get any "universal" code working that tries to detect whether the document it's in is xhtml or html. I found this, which tells me I have a hill to climb with no equipment....
6
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>
0
drhowarddrfine
by: drhowarddrfine | last post by:
The Doctype or DTD Many coders get confused by all the talk of doctypes and how they affect browsers and the display of their web pages. This article will get right to the point about doctypes...
6
by: WT | last post by:
Hello, I am searching for a way to generate automatically from codebehind the <!Doctype....for asp.net pages using .net 3.5 c# and vs2008. Subidiary question: if I do a server transfert in my...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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,...

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.