Show XML tags in HTML

Show XML tags in HTML

am 05.07.2007 23:29:27 von Nick Locke

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


xxxx

hhhhhhh


oooooo


Hello World

oooooo





At the moment, that renders as:

hhhhhhhh
oooooo
Hello World
oooooo

Whereas what I need is:

hhhhhhhh
oooooo
Hello World
oooooo

I have tried wrapping the XML in
 and 

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.

Re: Show XML tags in HTML

am 05.07.2007 23:35:23 von Ben C

On 2007-07-05, Nick Locke wrote:
> I have a need to display some XML without IE interpreting the tags. I want
> something like this:
>
>
>xxxx
>
>

hhhhhhh


>

oooooo


>Hello World
>

oooooo


>
>
[...]
> Whereas what I need is:
>
> hhhhhhhh
> oooooo
>Hello World
> oooooo
>
> I have tried wrapping the XML in
 and 

> and both still just lose the tags. View Source works fine, but I need to
> see the tags within the page itself.
>
> Ideas welcome!

<xmltag>Hello world</xmltag>

Re: Show XML tags in HTML

am 05.07.2007 23:46:45 von jkorpela

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.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Re: Show XML tags in HTML

am 08.07.2007 15:09:43 von GreatArtist

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

Re: Show XML tags in HTML

am 08.07.2007 15:22:47 von a.nony.mous

GreatArtist wrote:

> 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.

--
-bts
-Motorcycles defy gravity; cars just suck

Re: Show XML tags in HTML

am 08.07.2007 15:47:43 von jkorpela

Scripsit Beauregard T. Shagnasty:

> GreatArtist wrote:
>
>> 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, 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.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/