Re: Why does my browser not interpret the escaped HTML tags?

Giganews Newsgroups
Subject: Re: Why does my browser not interpret the escaped HTML tags?
Posted by:  Jan Roland Eriksson (jrex…@newsguy.com)
Date: Thu, 02 Sep 2004

On 1 Sep 2004 11:07:52 -0700, sy…@yahoo.com (Robert Bowen) wrote:

>Hello peeplez.

Hmm...

>I have an odd problem.

No, you just need to learn a bit more.

>When I put the ANSI symbol...

"ANSI" is not really applicable to the WWW. It comes by the expansion of
the ABBR/ACRONYMS themselves.

ANSI = American National Standards Institute
(USA based in reality).

WWW = World Wide Web (and the 'world' is by magnitudes
bigger than US-America :-)

>...for "less than" ("<"), the word STRONG and then the ANSI
>symbol for "greater than" (">") in my web page, followed by
>some text, then close the STRONG tag the same way, my text
>appears in bold. No problem.

That's the "intended default" behavior in user agents, yes.

>When I do the same things with the corresponding HTML tags
>(&lt; , &gt; ) the tag is not interpreted, it is simply
>displayed: <STRONG>text</STRONG>

That's also the intended default behavior in user agents.

>... What do I have to do to make my browser (Firefox or
>Explorer) interpret the tag?

You need to develop an understanding of the difference between serving
your browser just one single byte of data as represented by e.g. the
characters '<' or '>' as opposed to serving the same browser a series of
four characters as in your example '&lt;' or '&gt;' where the initial
'&' character has a special meaning.

In HTML (and SGML of course) the '&' character directly followed by a
valid 'NAME START' character, and possibly a sequence of valid 'NAME
CHARACTER's, signals to the browser to go into a lookup table and look
for a character replacement for the 'entity' reference just given.

If it can find a replacement character for the '&...' sequence, that's
the character(sequence) it is supposed to show in display.

I once wrote a page that takes the expansion of entities a little bit
further. You can always try to follow the experiment as I wrote it, and
if you do, I think that you will understand a bit more about entity
references. (i.e. those pesky &whatever; thingies :-)

  http://www.css.nu/markup/markup-entities.html>

Side note: the ending ';' character is not formally required in all
cases either but to keep it safe, just put it in for now will you?
(it is the character sequence between the '&' and the ';' that points
into the entity expansion "look-up table")

All the best...

--
Rex

Replies

In response to

Why does my browser not interpret the escaped HTML tags? posted by Robert Bowen on 1 Sep 2004