how to display xml?

  • Thread starter Thread starter Peter Kirk
  • Start date Start date
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
 
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
 
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
 
Set the mime type to xml and open the document directly in the browser
 
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

Back
Top