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

In article <9607240020.AA11739@trystero.art.com>,
Joe English <joe@trystero.art.com> 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:
> 
> 	<SCRIPT SRC="http://www.foo.com/myscript.js"></SCRIPT>

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?

Galactus

-- 
To find out more about PGP, send mail with HELP PGP in the SUBJECT line to me.
E-mail: galactus@stack.urc.tue.nl - Please PGP encrypt your mail if you can.
Finger galactus@turtle.stack.urc.tue.nl for public key (key ID 0x416A1A35).
Anonymity and privacy site: <http://www.stack.urc.tue.nl/~galactus/remailers/>

Received on Wednesday, 24 July 1996 06:51:05 UTC