Quote:
|
Is it possible to remove the <....>
|
Yes, but I think your trying to do that because you don't know how to extract (read) the information in a xml file. Removing the tags just destroys the file. Your catalogue file does not have a name, I gave it 'loans.xml' and placed it in the same directory as the following javascript script.
Code:
<html>
<head>
<script type="text/javascript">
function loadXMLDoc()
{
var xmlhttp;
var txt,x,i;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
xmlDoc=xmlhttp.responseXML;
txt="";
x=xmlDoc.getElementsByTagName("ID");
y=xmlDoc.getElementsByTagName("date");
z=xmlDoc.getElementsByTagName("retdate");
p=xmlDoc.getElementsByTagName("SID");
for (i=0;i<x.length;i++)
{
txt=txt + x[i].childNodes[0].nodeValue +"<br />";
txt +=y[i].childNodes[0].nodeValue + "<br />";
txt +=z[i].childNodes[0].nodeValue + "<br />";
txt +=p[i].childNodes[0].nodeValue + "<br /><br />";
}
document.getElementById("myDiv").innerHTML=txt;
document.getElementById("push").style.display = 'none';
}
}
xmlhttp.open("GET","loans.xml",true);
xmlhttp.send('');
}
</script>
</head>
<body>
<div id="myDiv"></div>
<button type="button" id="push" onclick="loadXMLDoc()">Decode xml File</button>
</body>
</html>
It's a little clunky but I think you can see whats going on. As for me I think I'll start to relearn xml and update my code.