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

Daniel W. Connolly (
Tue, 12 Jul 1994 16:09:25 +0200

In message <>, Bert Bos writes:
> '>' is not special.

'>' is not _necessarily_ special, but
in some cases it is. ]]> is the marked section end delimiter.

The easiest way to tell folks a simple algorithm for representing
an arbitrary string in PCDATA is to say
"replace all &, <, and > with entity references or
numeric character entities."

Note that the spec says that this is sufficient -- it doesn't say
it's necessary.

>To widen the discussion a bit: I know this definition of PRE is
>current practice, but can't we change it? I've always wondered why
>PRE wasn't defined as
> <!element pre - - cdata>
>that way you could _really_ enclose any piece of program code in PRE
>tags, without having to remove `<' and `&'.

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.

Also, pre was born because folks wanted anchors inside their
preformatted text.