What are these characters? ">&lt"

C

colonel

They have shown up in script-generated html code and they are screwing
up my html display. Anyone have any clue as to where I could begin
looking? The script just generates html like this:

echo "<TR><TD>$PROC_1 - $PROC_1_CURRENT instances running</TD><TD>" >>
$BBTMP/$TEST

and somehow these "&gt;&lt" characters are being inserted, or
misunderstood from somewhere...

any advice?

Thanks,

the colonel
 
J

Jonathan N. Little

colonel said:
They have shown up in script-generated html code and they are screwing
up my html display. Anyone have any clue as to where I could begin
looking? The script just generates html like this:

echo "<TR><TD>$PROC_1 - $PROC_1_CURRENT instances running</TD><TD>" >>
$BBTMP/$TEST

and somehow these "&gt;&lt" characters are being inserted, or
misunderstood from somewhere...

any advice?

Thanks,

the colonel
Well the '&gt;' is the HTML entity for 'greater than' character '>'. The
'&lt' would be the 'less than' entity '<' if it had the required
trailing ';' semicolon.
 
O

Oli Filth

colonel said:
Thanks. That makes sense. Now I just need to figure out why the <
and > are being translated...
Well, whatever program you're using is doing it automatically for you.

It's necessary because otherwise the browser's HTML parser would see a
"<", for instance, and think that that's the start of an HTML tag and
possibly screw up. Writing it as &lt; makes it explicit that you want to
display a "<" symbol to the user. Same logic applies to &gt;, &amp;,
&quot;, and others.
 
D

David Håsäther

Jonathan N. Little said:
The '&lt' would be the 'less than' entity '<' if it had the
required trailing ';' semicolon.

In SGML, a Reference Close (";") is not required to end an entity
reference. Any non name character will also terminate the parsing, as
will the record end character.
In XML though, entity references must end with ";".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top