XML INTERNAL VIEW

You can also display an XML created in their own website:

<html> <body> <h1>XML DOM</h1> <div> <b>To:</b> <span id="to"></span> <b>From:</b> <span id="from"></span> <b>Title:</b> <span id="title"></span> <b>Text:</b> <span id="text"></span> </div> <script type="text/javascript"> str="<messages><message>"; str=str+"<from>John</from>"; str=str+"<to>Peter</to>"; str=str+"<title>Meeting</title>"; str=str+"<text>Remember out meeting</text>"; str=str+"</message></messages>"; if (window.DOMParser) { parser=new DOMParser(); xmlDoc=parser.parseFromString(str,"text/xml"); } else { // Microsoft Explorer xmlDoc=new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async=false; xmlDoc.loadXML(str); } document.getElementById("to").innerHTML= xmlDoc.getElementsByTagName("to")[0].childNodes[0].nodeValue; document.getElementById("from").innerHTML= xmlDoc.getElementsByTagName("from")[0].childNodes[0].nodeValue; document.getElementById("title").innerHTML= xmlDoc.getElementsByTagName("title")[0].childNodes[0].nodeValue; document.getElementById("text").innerHTML= xmlDoc.getElementsByTagName("text")[0].childNodes[0].nodeValue; </script> </body> </html>