I want to show XML data in DIV. My xml code is below:
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don’t forget me this weekend!</body>
</note>
I want it to be displayed exactly as it is in a div, with all line spacing and xml tags exactly as they are.
Is this possible?
So I guess your problem is that you are trying to put the XML code into the DIV, and the browser tries to interprete the XML tags as HTML tags? You can prevent that by replacing all “<” and “>” in the XML code with the HTML special chars > and <.