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

MegaZone <megazone@livingston.com> wrote:

> Is *this* legal SGML?
>
> <SCRIPT>
> <!-- // <![CDATA[
> my script here
> // ]]> -->
> </SCRIPT>

Let's see...

In Wilbur (where SCRIPT has the content model (#PCDATA)*),
yes, as long as the script does not contain a COM (--) delimiter.
However, since everything is inside a comment declaration,
the element has no content.  (The initial and final record-ends
also get swallowed by the parser.)

In Cougar (where SCRIPT has CDATA declared content),
yes, as long as the script does not contain an ETAGO (</)
delimiter-in-context.  In this case, the content of the
element is:

	<!-- // <![CDATA[
	my script here
	// ]]> -->

(Inside CDATA declared content, the sequences MDO COM (<!--),
MDO DSO (<![), DSC MDC (]]>) and COM MDC (-->) are all
parsed as data.)

> (Like would the comment marker cause the SGML start tag to be commented out
> and not parsed by the validator?  If so, how about:
> <SCRIPT>
> // <![CDATA[
> <!--
> etc)

I'm not sure what you intended by "etc", but if you're
interested you can try running it through a validator.

It seems to me that what you and others on this list
are trying to do is come up with a magic sequence
of characters that will simultaneously:

  1) Fool "old browsers" into ignoring scripts;
  2) Fool SGML parsers into not complaining about bad markup;
  3) Fool "new browsers" to not choke on the stuff that
     was inserted to achieve 1) and 2), while
     also managing to recognize the script.

I think there is a fundamental problem with this approach.



--Joe English

  joe@art.com

Received on Sunday, 28 July 1996 18:13:33 UTC