Tips - How to display a XML Tags in a HTML Web Page
ADVERTISEMENTDisplaying a XML document in HTML would not display properly because the browser will apply formatting to XML document and one of the way to tell browser not to apply formatting is to use the ‘<’
For example if you would like to show the following XML code in your html page.
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don’t forget me this weekend!</body>
</note>
it will display as shown below
Tove Jani Reminder Don't forget me this weekend!
and if you want avoid this behaviour then all you need to do is to replace all < element with ‘<’ (remove single quotes).
Technorati Tags: Display XML, HTML, Browser formatting







