Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Show XML tags in HTML

Reply
Thread Tools

Show XML tags in HTML

 
 
Nick Locke
Guest
Posts: n/a
 
      07-05-2007
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.



 
Reply With Quote
 
 
 
 
Ben C
Guest
Posts: n/a
 
      07-05-2007
On 2007-07-05, Nick Locke <(E-Mail Removed)> wrote:
> 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;
 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      07-05-2007
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/

 
Reply With Quote
 
nmi nmi is offline
Junior Member
Join Date: Jul 2007
Posts: 13
 
      07-06-2007
Use <xmp>. It's told to be deprecated, but it works fine.
 
Reply With Quote
 
GreatArtist
Guest
Posts: n/a
 
      07-08-2007
I think you're not competent to write messages on Usenet until you
stop being an asshole.

 
Reply With Quote
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      07-08-2007
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
 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      07-08-2007
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/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Show full path to all tags in xml (xslt newbie) Critcho XML 1 09-06-2010 03:13 PM
All style tags after the first 30 style tags on an HTML page are not applied in Internet Explorer Rob Nicholson ASP .Net 3 05-28-2005 03:11 PM
html tags within meta tags allowed? Donald Firesmith XML 5 01-08-2005 11:29 PM
RegEx to find CFML tags nested in HTML tags Dean H. Saxe Perl 0 01-03-2004 06:11 PM
Custom Tags within Custom Tags. Ranganath Java 2 10-21-2003 06:14 AM



Advertisments