?
Solved

Display XML content in a div on a webpage

Posted on 2008-06-25
5
Medium Priority
?
2,038 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 2000 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

Give Your Engineering Team a Productivity Boost

Learn why container technology is so powerful and how it can provide your team with productivity gains and other benefits.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

770 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