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

Joe English (joe@trystero.art.com)
Wed, 24 Jul 1996 15:49:41 PDT


Message-Id: <9607242249.AA18838@trystero.art.com>
To: www-html@w3.org
Subject: Re: Cougar DTD: Do not use CDATA declared content for SCRIPT 
In-Reply-To: <960724182118_369416462@emout13.mail.aol.com> 
Date: Wed, 24 Jul 1996 15:49:41 PDT
From: Joe English <joe@trystero.art.com>


Jonsm@aol.com wrote:

> In common practice I am seeing:
> 
> <SCRIPT>
> <!--
> write whatever you want here
> -->
> </SCRIPT>
> 
> This has the advantage of removing the problems with CDATA and end tags.

Not really.  If the SCRIPT element has CDATA declared content, 
then <!-- is parsed as data, not the beginning of a comment declaration,
so you have:

	<SCRIPT>
	<!--
	put anything here except for an ETAGO delimiter-in-context.
	This still breaks:
		document.write("</H1>");
	-->
	</SCRIPT>

If the SCRIPT element has (#PCDATA) as its content model, 
then you have:

	<SCRIPT>
	<!--
	put anything here except for a COM delimiter.
	Now this breaks:
		--counter;
	-->
	</SCRIPT>

> It also ensure that the scripts will be invisible to older browsers.
> It has the disadvantage of putting your scripts into comments.



--Joe English

  joe@art.com