Link to home
Start Free TrialLog in
Avatar of Relegence
RelegenceFlag for Israel

asked on

Display XML content in a div on a webpage

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
Avatar of ofkr
ofkr
Flag of Singapore image

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>.
Avatar of Relegence

ASKER

what is <xmp>, i can't find it in my controls list
ASKER CERTIFIED SOLUTION
Avatar of ofkr
ofkr
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you!!
Just 1 little question - the XML is displayed as 1 long row, no indentation.
How can I fix that?

Thanks