Re: Using "&...;" in <PRE> sections

Daniel W. Connolly (connolly@hal.com)
Tue, 12 Jul 1994 10:30:19 -0500


In message <9407121451.AA16868@freya.let.rug.nl>, Bert Bos writes:
>Dan Connolly writes:
>
> |There's no way to represent the string </x inside CDATA. None. So
> |if your program includes that string (or ]]>) you're out of luck.
>
>Yes, the characters "</" followed by a letter may not occur in an
>element declared as CDATA, but how often will that happen?

It only has to happen once in the whole World-Wide Web, and
my point is made. Here's a C program that you can't put in
a cdata element:

main()
{
printf("example SGML: <xyz>...</xyz>\n");
}

>Aside:
>
>The string "</" would not be special (but "]]>" would) in an
>`unparsable marked section', another obscure SGML feature: you can
>actually include CDATA anywhere, by enclosing it in <![ CDATA [...]]>,
>like this:
>
> <P>This is a normal paragraph, but it has some strange characters
> in it and I'm too lazy to replace them with entities... <![ CDATA [
> < > </ & <! <!-- ]]>

This is the preferred method for using CDATA. See
wais://ftp.ifi.uio.no/comp.text.sgml?CDATA

for several articles by Erik Naggum on the evils of CDATA declared
content models, and the virtue of marked sections.

Now we just have to get marked section parsing in libWWW...

Dan