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

Bert Bos (bert@let.rug.nl)
Tue, 12 Jul 1994 11:45:52 +0200 (METDST)


|A question: when a <PRE>formatted part must show "<" and ">" characters, do
|I have to replace them by &lt; and &gt; or not ?
|
|If I do that, Mosaic for SunOS shows "<" and ">", but MacMosaic 1.0.3 shows
|"&lt;" and "&gt;". The documents about html that I have read do not say
|anything explicit about this situation.
|Does anybody know what *THE* statndard says about this situation ?

*The* standard in this case is SGML. In all versions of the HTML DTD
that I have seen, PRE has so-called `mixed content', that means that
tags must be recognized as tags, which in turn means that `<' is a
special delimiter. The answer therefore must be: use &lt;. (Btw. `>'
is not special.)

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 `&'.

In HTML 3.0 at least, we don't need PRE (as it is currently defined)
anymore. Consider:

<pre>
a line in a fixed width font
an <b>indented</b> line in a fixed width font
another <b>indented</b> line in a fixed width font
</pre>

But if people are going to add <B> and <HR> to their `verbatim' code,
why not also add <BR> and <TAB>?

<p>
<tt><hide>xxxx<tab id=t1>xxxx<tab id=t2></hide>
a line in a fixed width font<br>
<tab to=t1>an <b>indented</b> line in a fixed width font<br>
<tab to=t2>another <b>indented</b> line in a fixed width font
</tt>

Bert

-- 
___________________________________________________________________________
####[ Bert Bos                     ]####[ Alfa-informatica,           ]####
####[ <bert@let.rug.nl>            ]####[ Rijksuniversiteit Groningen ]####
####[ http://www.let.rug.nl/~bert/ ]####[ Postbus 716                 ]####
####[                              ]####[ NL-9700 AS GRONINGEN        ]####
####[______________________________]####[_____________________________]####

+++ Hey! I'm a .signature virus. Help me and include me in your .sig file! +++