Solved

Display XML content in a div on a webpage

Posted on 2008-06-25
5
1,980 Views
Last Modified: 2009-02-26
Hello,

I would like, on a button click,  to display XML content within a div on my webpage.
I have the XML on the server side as a long string (I don't have an xml file).

How can I do that?

Thanks
0
Comment
Question by:Relegence
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 3

Expert Comment

by:ofkr
ID: 21863626
You can replace all of your xml's "<" with &lt; and  ">" with &gt; before deplaying your string.

Another option : You could also try putting <xmp> (Your XML String) </xmp>.
0
 

Author Comment

by:Relegence
ID: 21863661
what is <xmp>, i can't find it in my controls list
0
 
LVL 3

Accepted Solution

by:
ofkr earned 500 total points
ID: 21863696
As you have the XML on the server side as a long string, you just need to put the string "<xmp>" at the begining of your XML string and "</xmp>" at the end of your XML string before displaying within <DIV> tag.

You will need to code a little bit for that. Hope that is your requirement.
0
 

Author Comment

by:Relegence
ID: 21863753
Thank you!!
0
 

Author Comment

by:Relegence
ID: 21863794
Just 1 little question - the XML is displayed as 1 long row, no indentation.
How can I fix that?

Thanks
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question