Show XML tags in HTML

N

Nick Locke

I have a need to display some XML without IE interpreting the tags. I want
something like this:

<html>
<head><title>xxxx</title></head>
<body>
<h1>hhhhhhh</h1>
<p>oooooo</p>
<xmltag>Hello World</xmltag>
<p>oooooo</p>
</body>
</html>

At the moment, that renders as:

hhhhhhhh
oooooo
Hello World
oooooo

Whereas what I need is:

hhhhhhhh
oooooo
<xmltag>Hello World</xmltag>
oooooo

I have tried wrapping the XML in <pre></pre> and <blockquote></blockquote>
and both still just lose the tags. View Source works fine, but I need to
see the tags within the page itself.

Ideas welcome!

Thanks, Nick.
 
B

Ben C

I have a need to display some XML without IE interpreting the tags. I want
something like this:

<html>
<head><title>xxxx</title></head>
<body>
<h1>hhhhhhh</h1>
<p>oooooo</p>
<xmltag>Hello World</xmltag>
<p>oooooo</p>
</body>
</html> [...]
Whereas what I need is:

hhhhhhhh
oooooo
<xmltag>Hello World</xmltag>
oooooo

I have tried wrapping the XML in <pre></pre> and <blockquote></blockquote>
and both still just lose the tags. View Source works fine, but I need to
see the tags within the page itself.

Ideas welcome!

&lt;xmltag&gt;Hello world&lt;/xmltag&gt;
 
J

Jukka K. Korpela

Scripsit Nick Locke:
I have a need to display some XML without IE interpreting the tags.

If you were not able to figure that out on your own, are you really
competent to write documents about XML issues? After all, XML has just the
same principle in this respect as HTML does. At the minimum, the "<"
character must be written using an entity reference or a character
reference. Any "&" character must be "escaped" in a similar manner. There's
no need to "escape" the ">" character, but people usually do that, for
symmetry.
 
G

GreatArtist

I think you're not competent to write messages on Usenet until you
stop being an asshole.
 
B

Beauregard T. Shagnasty

GreatArtist said:
I think you're not competent to write messages on Usenet until you
stop being an asshole.

Who isn't competent? You didn't quote anything.

Well, if as I suspect it was Jukka, consider this: once you get past
the brusqueness of his posts, you will find sound advice. Relax a bit,
read carefully. Take your meds if necessary.
 
J

Jukka K. Korpela

Scripsit Beauregard T. Shagnasty:
Who isn't competent? You didn't quote anything.

Well, this was rather obvious: "GreatArtist" used the pronoun "you" in the
generic sense, referring to any person - and, in this, particularly
applicable to "GreatArtist" himself/herself/itself.
 

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,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top