Solved

Display XML content in a div on a webpage

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
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…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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

19 Experts available now in Live!

Get 1:1 Help Now