Re: Parsing < and <

lilley (lilley@afs.mcc.ac.uk)
Thu, 20 Apr 95 16:23:56 EDT

Luke Y. Lu writes:

> Is there any difference between &#60 and < etc. in current html 2.0
> spec? I can't seem to find a authoritative answer. I noticed an "anomaly"
> in netscape 1.1b3 today: it "eats" the following html fragment:
>
> <stuff>
>
> i.e., it seems to unescape &#NN first then feed it to the parser...
>
> <stuff>
>
> is displayed as <stuff> though.

Four characters are used for markup and thus might be misinterpreted in
some contexts: < > " & So you need a way to insert these special characters
such that they are not treated as markup. Named entities is that way.

The numerical references, though, are just the same as typing in the actual
characters. You would only use &#60; &#62; if, for example, your keyboard
did not have the < > characters (which would be a royal pain for hand
editing HTML!)

For other characters which are not used as markup, there is no difference
in practive between the numeric reference and the named entity.

If you have access to a Unix system, you might like to try checking this
sort of question against the DTD, which is quicker than running up every
browser in your collection. Check out:

<http://www.halsoft.com/html-tk/>

--
Chris Lilley
+----------------------------------------------------------------------+
|Technical Author, Manchester and North HPC Training & Education Centre|
+----------------------------------------------------------------------+
| Computer Graphics Unit,             |  Email: Chris.Lilley@mcc.ac.uk |
| Manchester Computing Centre,        |  Voice: +44 61 275 6045        |
| Oxford Road, Manchester, UK.M13 9PL |    Fax: +44 61 275 6040        |
+-------------------------------------+ BioMOO: ChrisL                 |
|       URI: http://info.mcc.ac.uk/CGU/staff/lilley/lilley.html        | 
+----------------------------------------------------------------------+
|       "The first W in WWW will not wait."   François Yergeau         |
+----------------------------------------------------------------------+