Re: XMP

Neil St.Laurent wrote:
> > 	<PRE>
> > 	<![CDATA[
>
> Why can't just a regular tag have content that is of type CDATA?  I
> don't see anything in SGML that eliminates that option...

That feature is exactly what 'XMP' uses.  That feature is broken.
That's why 'XMP' has been obsoleted.

Russell Steven Shawn O'Connor <roconnor@wronski.math.uwaterloo.ca>
wrote:
>
> In data marked with <![CDATA[ ...  the sequence of `]]>' is not allowed
> and must be escaped.

Actually, since markup recognition is turned off completely
(except for the terminating delimiter) inside CDATA declared
content ']]>' *can't* be escaped; you have to close the
marked section, enter the (escaped) delimiter, and start a
new marked section:

	<![CDATA[
	Putting the string ]]>"]]&gt;"<![CDATA[ inside a
	CDATA marked section is awkward, but not impossible.
	]]>

> With a CDATA tag such as <XMP> the sequence of `</'
> is not allowed and must be escaped.

In fact, since '</' *can't* be escaped, there is *no way at all*
to include it in an element with CDATA declared content.

This makes XMP (and SCRIPT) pretty much useless for embedding
unparsed HTML markup.

    <script>
    document.write("<h2>This is invalid HTML</h2>")
    <script>


> Certainly the sequence of `]]>' is less likely to come up.

True.

> That's all the diffrerence that I really know, other than the fact the
> that when you use CDATA marked sections it is really obvious that you are
> in a CDATA block.

That's the main advantage of marked sections over elements with
declared content.  Also, marked sections can be used inside any
element type.


--Joe English

  joe@art.com

Received on Tuesday, 12 August 1997 16:17:25 UTC