Solved

Display XML content in a div on a webpage

Posted on 2008-06-25
5
1,852 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
  • 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

706 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now