Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 05:28 PM
CJM
Guest
 
Posts: n/a
Default Doctype quickie!

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


  #2  
Old July 20th, 2005, 05:28 PM
Steve Pugh
Guest
 
Posts: n/a
Default Re: Doctype quickie!

"CJM" <cjmwork@yahoo.co.uk> wrote:
[color=blue]
>Are DOCTYPE statements case sensitive?[/color]

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.
[color=blue]
>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.[/color]

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 <steve@pugh.net> <http://steve.pugh.net/>
  #3  
Old July 20th, 2005, 05:28 PM
Jukka K. Korpela
Guest
 
Posts: n/a
Default Re: Doctype quickie!

"CJM" <cjmwork@yahoo.co.uk> wrote:
[color=blue]
> Are DOCTYPE statements case sensitive?[/color]

The part that is in quotation marks is case sensitive. The rest isn't.
[color=blue]
> I cant remember where, but I'm sure I read that case *does* matter...[/color]

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.
[color=blue]
> eg.
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "http://www.w3.org/TR/html4/strict.dtd>[/color]

There's a missing quotation mark near the end. Otherwise, the incantation is
correct.
[color=blue]
> ...will work [ie trigger 'Standards mode'], but...[/color]

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.
[color=blue]
> <!doctype html public "-//w3c//dtd html 4.01//en"
> "http://www.w3.org/tr/html4/strict.dtd>
>
> ..won't.[/color]

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

  #4  
Old July 20th, 2005, 05:28 PM
CJM
Guest
 
Posts: n/a
Default Re: Doctype quickie!

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


  #5  
Old July 20th, 2005, 05:52 PM
Anne van Kesteren
Guest
 
Posts: n/a
Default Re: Doctype quickie!

CJM wrote:[color=blue]
> 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.[/color]

Are empty tags also rendered correctly: <br/>? Otherwise it doesn't make
much sense I think.
[color=blue]
> 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![/color]

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?
[color=blue]
> Cheers
>
> CJM
>
>[/color]


--
Anne van Kesteren
<http://www.annevankesteren.nl/>
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles