467,911 Members | 1,519 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,911 developers. It's quick & easy.

Why does my browser not interpret the escaped HTML tags?

Hello peeplez. I have an odd problem. When I put the ANSI symbol 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.

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>

.... the same thing happens with any tag. What do I have to do to make
my browser (Firefox or Explorer) interpret the tag?

Thank you,
clueless ... I mean syg
Jul 23 '05 #1
  • viewed: 9439
Share:
18 Replies
"Robert Bowen" <sy**@yahoo.com> wrote in message
news:77**************************@posting.google.c om...
Hello peeplez. I have an odd problem. When I put the ANSI symbol 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.

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>

... the same thing happens with any tag. What do I have to do to make
my browser (Firefox or Explorer) interpret the tag?


Don't use the character entities &lt; and &gt; unless you want the '<' and
'>' characters to appear.
Jul 23 '05 #2
Robert Bowen <sy**@yahoo.com> wrote:
Hello peeplez. I have an odd problem. When I put the ANSI symbol 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.

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>

... the same thing happens with any tag. What do I have to do to make
my browser (Firefox or Explorer) interpret the tag?


You need to use

<strong>text</strong>

rather than

&lt;strong&gt;text&lt;/strong&gt;

Or am I missing something?
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"The world owes you nothing. It was here first." - Mark Twain
Jul 23 '05 #3
On 1 Sep 2004 11:07:52 -0700, Robert Bowen <sy**@yahoo.com> wrote:
Hello peeplez.
Grrr.. :)
I have an odd problem. When I put the ANSI symbol 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 correct.
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>

... the same thing happens with any tag.
That's also correct behavior. &lt; is used to make the UA render <, as an
actual < will be seen as the start of a tag.
What do I have to do to make
my browser (Firefox or Explorer) interpret the tag?


Use < and >.

If you're trying to get around some HTML filter in a web forum, tough
luck, this won't work. &lt; can't ever start a tag, it's a rendered
character.
Jul 23 '05 #4
sy**@yahoo.com (Robert Bowen) wrote:
Hello peeplez. I have an odd problem. When I put the ANSI symbol 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.

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>

... the same thing happens with any tag. What do I have to do to make
my browser (Firefox or Explorer) interpret the tag?

Thank you,
clueless ... I mean syg


First, that's not exactly "escaping". Escaping is preceding a symbol
with something that indicates that it should be interpreted in the
normal way instead of in a special way (or vice-versa, depending on
your poiint of view). You're replacing < and > altogether.

Second, that's what escaping is *for*: to avoid the treatment that
would otherwise be given to some symbol. If you are surprised that
escaping (or, in this case, replacement with entity codes) produces
different treatment, then you were missing the point, and leads to the
question: why were you using &lt; and &gt;, if you wanted the *same*
result as using < and > ?
--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.
Jul 23 '05 #5
Robert Bowen wrote:
Hello peeplez. I have an odd problem. When I put the ANSI symbol 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.

When I do the same things with the corresponding HTML tags (&lt; ,
&gt; ) the tag is not interpreted, it is simply displayed:
Yes, this is as it should be. I do not understand why you thing there
is a problem.
<STRONG>text</STRONG>

... the same thing happens with any tag. What do I have to do to make
my browser (Firefox or Explorer) interpret the tag?

Don't use the escaped values for angle brackets. Escape sequences exist
so that the characters can be displayed rather than interpreted.
--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jul 23 '05 #6
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
Jul 23 '05 #7
Jan Roland Eriksson wrote:
WWW = World Wide Web (and the 'world' is by magnitudes bigger than
US-America :-)


Really? The way GW Bush behaves, well, I naturally assumed the world and
the U.S. were synonymous.

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Jul 23 '05 #8
In our last episode,
<77**************************@posting.google.com >,
the lovely and talented Robert Bowen
broadcast on comp.infosystems.www.authoring.html:
Hello peeplez. I have an odd problem. When I put the ANSI symbol 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. 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 is exact what is supposed to happen.
... the same thing happens with any tag. What do I have to do to make
my browser (Firefox or Explorer) interpret the tag?


You have to put the tag in literal "<" and ">". The point of have
the character entities &lt; and &gt; is to allow you enter these
characters in text so they *won't* be interpreted as opening and
closing tag symbols.

--
Lars Eighner -finger for geek code- ei*****@io.com http://www.io.com/~eighner/
If it wasn't for muscle spasms, I wouldn't get any exercise at all.
Jul 23 '05 #9
Holy ... ! Man, I didn't intend to start a political conversation! And
certainly didn't mean to offend anyone by writing 'peeplez'. Not sure
why that bothers people but anyway, it was just something I wrote ...
to vary the opening sentence a bit. Sorry ...

Oh yea, and I used the acronym ANSI because in Editplus that's what it
calls it. There is an option -- Edit :: HTML :: HTML to ANSI and ANSI
to HTML. Again, no political intention ...

Now, as to my problem. I don't actually WANT to use these characters
but for some reason when I save certain info in my Oracle database
(saved as a BLOB), when it is displayed on my jsp page, it is spit out
that way. Looking at the database it SEEMS as if it's being saved
"normally", as "<" and ">", and not the HTML symbols. But when it is
displayed, that's what comes out ...

From what you all are saying the browser's job, upon seeing these
tags, is to render them, and that's all. It doesn't care if these
symbols are used to render HTML tags. If it happens to be a "<" or ">"
symbol, so be it, but it won't interpret them.

Ok well ... I wonder why Oracle saves BLOBs that way? It certainly is
annoying. If it saved them "normally" and not as HTML codes I suppose
my text would be displayed as I want it to be ...

Anyway, problem for another day.

Thanks for your responses, and sorry to have annoyed or offended.

syg

Brian <us*****@julietremblay.com.invalid> wrote in message news:<cfuZc.100117$Fg5.8422@attbi_s53>...
Jan Roland Eriksson wrote:
WWW = World Wide Web (and the 'world' is by magnitudes bigger than
US-America :-)


Really? The way GW Bush behaves, well, I naturally assumed the world and
the U.S. were synonymous.

Jul 23 '05 #10
sy**@yahoo.com (Robert Bowen) wrote:
Holy ... ! Man, I didn't intend to start a political conversation!
But you apparently intend to get ignored by knowledgedable people.
Upside-down quoting is a simple way, though not always reliable, for
that.
Oh yea, and I used the acronym ANSI because in Editplus that's what
it calls it. There is an option -- Edit :: HTML :: HTML to ANSI and
ANSI to HTML. Again, no political intention ...
Whether it has something to do with politics in your book is fairly
irrelevant. In that context, the use of the string "ANSI" is definitely
abuse of an organization's name for something that the organization has
_not_ defined or approved. In a word, bogosity.
Now, as to my problem. I don't actually WANT to use these characters
but for some reason when I save certain info in my Oracle database
(saved as a BLOB), when it is displayed on my jsp page, it is spit
out that way. Looking at the database it SEEMS as if it's being saved
"normally", as "<" and ">", and not the HTML symbols. But when it is
displayed, that's what comes out ...
Apparently you are trying to use a database without the necessary
prerequisites, such as understanding what's really happening. But that's
external to HTML.
From what you all are saying the browser's job, upon seeing these
tags, is to render them, and that's all. It doesn't care if these
symbols are used to render HTML tags. If it happens to be a "<" or
">" symbol, so be it, but it won't interpret them.


It seems that you need to read an HTML tutorial. Please come back when
you can at least describe your problem in an understandable way.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 23 '05 #11
On Thu, 2 Sep 2004, Jan Roland Eriksson wrote:
When I put the ANSI symbol...


"ANSI" is not really applicable to the WWW.

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


ANSI® and USA® are registered trademarks of Microsoft Corporation.

--
Top-posting.
What's the most irritating thing on Usenet?

Jul 23 '05 #12
On Thu, 2 Sep 2004 15:42:12 +0200, Andreas Prilop
<nh******@rrzn-user.uni-hannover.de> wrote:
On Thu, 2 Sep 2004, Jan Roland Eriksson wrote: [...]
ANSI = American National Standards Institute
(USA based in reality).

ANSI® and USA® are registered trademarks of Microsoft Corporation.


I would not be surprised to find that to be true :-)

MS holds a patent on Style Sheets and XML markup too.

<http://www.google.com/search?q=Microsoft+Patent+Markup>

<http://www.google.com/search?q=Microsoft+Patent+Stylesheet>

Several aspects of US market economy has gone nuts.
(and it's contagious, slowly creeping in over here too)

I will shut up from now on :-)

--
Rex
Jul 23 '05 #13
Lars Eighner <ei*****@io.com> wrote in message news:<sl*********************@goodwill.io.com>...
In our last episode,
<77**************************@posting.google.com >,
the lovely and talented Robert Bowen
broadcast on comp.infosystems.www.authoring.html:
Hello peeplez. I have an odd problem. When I put the ANSI symbol 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.

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 is exact what is supposed to happen.
... the same thing happens with any tag. What do I have to do to make
my browser (Firefox or Explorer) interpret the tag?


You have to put the tag in literal "<" and ">". The point of have
the character entities &lt; and &gt; is to allow you enter these
characters in text so they *won't* be interpreted as opening and
closing tag symbols.


Ok, understood. Didn't know that. Thanks for the polite, informed and
attitude-free response. So despite what the previous poster said, you
understood what I said? Go figure.

I subscribe to a bunch of different lists, mostly J2EE-related and get
tons of questions all the time, many of which can be answered by
reading FAQs or snooping around Google before-hand. Perhaps my
question was of this nature. But I never tell people they are stupid,
sling attitude or flame.

Anyway, cheers to those who gave helpful comments!

syg
Jul 23 '05 #14
On 2 Sep 2004 10:43:08 -0700, Robert Bowen <sy**@yahoo.com> wrote:
Ok, understood. Didn't know that. Thanks for the polite, informed and
attitude-free response. So despite what the previous poster said, you
understood what I said? Go figure.

I subscribe to a bunch of different lists, mostly J2EE-related and get
tons of questions all the time, many of which can be answered by
reading FAQs or snooping around Google before-hand. Perhaps my
question was of this nature. But I never tell people they are stupid,
sling attitude or flame.


I and a few others gave you this advice, and I believe most of us were
matter-of-fact but polite. In fact, after reviewing all the direct answers
to your question, I find no responses which seem to me to carry any
negative attitude. So I fail to see what you're upset about, sorry if this
is insensitivity on my part.

But it seems a shame to be upset by a response or two when it's clear (to
me) most provided an answer without any perceivable "attitude".
Jul 23 '05 #15
Robert Bowen wrote:
Now, as to my problem. I don't actually WANT to use these characters
but for some reason when I save certain info in my Oracle database
(saved as a BLOB), when it is displayed on my jsp page, it is spit out
that way. Looking at the database it SEEMS as if it's being saved
"normally", as "<" and ">", and not the HTML symbols. But when it is
displayed, that's what comes out ...


I haven't seen your page, but my best guess is that the data is stored
correctly in the database, and that you're using a pre-written JSP
script which automatically adds the entities (that's what &lt; and &gt;
are called).
Jul 23 '05 #16
In our last episode,
<77**************************@posting.google.com >,
the lovely and talented Robert Bowen
broadcast on comp.infosystems.www.authoring.html:
Lars Eighner <ei*****@io.com> wrote in message news:<sl*********************@goodwill.io.com>...
In our last episode,
<77**************************@posting.google.com >,
the lovely and talented Robert Bowen
broadcast on comp.infosystems.www.authoring.html:
> Hello peeplez. I have an odd problem. When I put the ANSI symbol 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.
> 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 is exact what is supposed to happen.
> ... the same thing happens with any tag. What do I have to do to make
> my browser (Firefox or Explorer) interpret the tag?


You have to put the tag in literal "<" and ">". The point of have
the character entities &lt; and &gt; is to allow you enter these
characters in text so they *won't* be interpreted as opening and
closing tag symbols.

Ok, understood. Didn't know that. Thanks for the polite, informed and
attitude-free response. So despite what the previous poster said, you
understood what I said? Go figure.


From later discussions, I understand your real problem is that some
software you are using saves tags using &lt; and &gt; I know this is
often the case with markup you are invited to copy (such as banner
codes). Experiment with various "Save As" options with your software.
Perhaps you will find one that will save what you see as < and > as <
and >. If you can't find one, I suggest you write a little perl
script or a macro for your text editor that will make these changes
for you.

--
Lars Eighner -finger for geek code- ei*****@io.com http://www.io.com/~eighner/
If it wasn't for muscle spasms, I wouldn't get any exercise at all.
Jul 23 '05 #17
Lars Eighner <ei*****@io.com> wrote in message news:<sl*********************@goodwill.io.com>...
In our last episode,
<77**************************@posting.google.com >,
the lovely and talented Robert Bowen
broadcast on comp.infosystems.www.authoring.html:
Lars Eighner <ei*****@io.com> wrote in message news:<sl*********************@goodwill.io.com>...
In our last episode,
<77**************************@posting.google.com >,
the lovely and talented Robert Bowen
broadcast on comp.infosystems.www.authoring.html:

> Hello peeplez. I have an odd problem. When I put the ANSI symbol 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. 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 is exact what is supposed to happen.

> ... the same thing happens with any tag. What do I have to do to make
> my browser (Firefox or Explorer) interpret the tag?

You have to put the tag in literal "<" and ">". The point of have
the character entities &lt; and &gt; is to allow you enter these
characters in text so they *won't* be interpreted as opening and
closing tag symbols.

Ok, understood. Didn't know that. Thanks for the polite, informed and
attitude-free response. So despite what the previous poster said, you
understood what I said? Go figure.


From later discussions, I understand your real problem is that some
software you are using saves tags using &lt; and &gt; I know this is
often the case with markup you are invited to copy (such as banner
codes). Experiment with various "Save As" options with your software.
Perhaps you will find one that will save what you see as < and > as <
and >. If you can't find one, I suggest you write a little perl
script or a macro for your text editor that will make these changes
for you.

What I have is a jsp page which has that Microsoft Internet Explorer
edit window which allows you to input HTML-marked-up text, with HTML
tags, etc. The JDBC driver sends it to the Oracle database which saves
it as a BLOB. I guess it's Oracle's BLOB storage which is making my
life miserable. I did a copy-paste direct from the database to a text
editor and viewed it in a browser, same problem -- the tags are not
interpreted.

I guess what I'll do it write a little parser in java that subsitutes
the symbols for the tags. Kind of defeats the purpose of saving
marked-up text but anyway.

BTW, I *was* only talking about the one poster who took it upon
himself to slag me off instead of offering help, or simply ignoring
me. Aside from him ALL responses *were* helpful, and I take this
chance to thank you all again.

syg
Jul 23 '05 #18
Robert Bowen wrote:

What I have is a jsp page which has that Microsoft Internet Explorer
edit window which allows you to input HTML-marked-up text, with HTML
tags, etc. The JDBC driver sends it to the Oracle database which saves
it as a BLOB. I guess it's Oracle's BLOB storage which is making my
life miserable. I did a copy-paste direct from the database to a text
editor and viewed it in a browser, same problem -- the tags are not
interpreted.

You are guessing about where the conversion occurs.
If the text is stored as a BLOB, there is no reason for the conversion
to char entities since the storage is binary, byte-for-byte exact, no
interpretation whatever. Why would it care?
The most likely place for the conversion is the special IE edit window.
Capture the output from that and see what it looks like.

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jul 23 '05 #19

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by bayram guzer | last post: by
2 posts views Thread by Chris | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.