Solved

Display XML content in a div on a webpage

Posted on 2008-06-25
5
2,003 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

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!
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

729 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