how to display xml?

P

Peter Kirk

Hi there

say I have a string which contains xml. How do I display this on my
webpage - as tags in an hierarchical structure?

Thanks,
Peter
 
K

Kevin Spencer

You can display it any way you want. How do you want to dislay it?

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Development Numbskull

Nyuck nyuck nyuck
 
P

Peter Kirk

Kevin Spencer said:
You can display it any way you want. How do you want to dislay it?

Well I would like to see things like:

<item id="123">
<content>value</content>
<home name="solutions">
<address>
<street></street>
<post>0067</post>
</address>
</home>
</item>

etc.

But I was not getting the tags, only their contents (I think the browser was
confused by the tags - maybe it thought it was html or something?).

Anyway I found out to "html-encode" it, and make sure I padded the string
with <br> tags and spaces at the appropriate places to give an hierarchical
structure to the output.

Peter
 
K

Kevin Spencer

Yes, either way (HtmlEncode or set MIME type) would work. Of course, if you
want it to be in an HTML document with other HTML, you would go with the
HtmlEncode method.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Development Numbskull

Nyuck nyuck nyuck
 

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

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top