Re: Cougar DTD: Do not use CDATA declared content for SCRIPT

Arnoud (
Wed, 24 Jul 1996 12:39:53 +0200

From: (Arnoud "Galactus" Engelfriet)
Subject: Re: Cougar DTD: Do not use CDATA declared content for SCRIPT
Date: Wed, 24 Jul 1996 12:39:53 +0200
Message-ID: <>

In article <>,
Joe English <> wrote:
> 1) Use <!ELEMENT SCRIPT - - (#PCDATA)>, and require all occurrences
> of '<', '&', and '>' in the content to be replaced with '&lt;',
> '&amp;', and '&gt;'.  This is more consistent with the rest of HTML.

Breaks all existing script-supporting browsers. They expect the bare
'<', '>' and '&' characters, as they insert them literally in the
parser. This would mean document.write("&lt;H1&gt;") inserts the
literal text "<H1>" rather than the element "<H1>" in the text.

> 2) Use <!ELEMENT SCRIPT - - (#PCDATA)> and add browser support 
> for CDATA marked sections:
>     <SCRIPT><![ CDATA [
> 	document.write("<H1>", "Foo", "</H1>")
>     ]]></SCRIPT>
> This is the approach favored by most other SGML applications.

Good concept, but it won't work either, I'm afraid. Current browsers
don't use SGML parsers, and even if we could get NS & MS to implement
those in their next versions, all the old browsers would greatly
barf on this.

> 3) Allow scripts to be included by external reference:

Very good idea!  I'll second this.  We now get the "inline vs SRC" debate
again, especially since <SCRIPT> is a container and not an empty element.
People will still want to inline small scripts, so how do you propose
we declare the contents of <SCRIPT> with the above addition?


To find out more about PGP, send mail with HELP PGP in the SUBJECT line to me.
E-mail: - Please PGP encrypt your mail if you can.
Finger for public key (key ID 0x416A1A35).
Anonymity and privacy site: <>