I have a xml file and some tags have dots in it like this <m:properties></m:properties>
but when I try to read it it doesn't work.
This is the code how I read it:
displayCD(0);
function displayCD(i) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
myFunction(xmlhttp, i);
}
}
xmlhttp.open("GET", "text.xml", true);
xmlhttp.send();
}
function myFunction(xml, i) {
var xmlDoc = xml.responseXML;
x = xmlDoc.getElementsByTagName("ENTRY");
document.getElementById("text").innerHTML =
"Artist: " +
x[i].getElementsByTagName("id")[0].childNodes[0].nodeValue +
"<br>Title: " +
x[i].getElementsByTagName("type")[0].childNodes[0].nodeValue +
"<br>Year: " +
x[i].getElementsByTagName("title")[0].childNodes[0].nodeValue +
"<br>Price: " +
x[i].getElementsByTagName("body")[0].childNodes[0].nodeValue +
"<br>Price: " +
x[i].getElementsByTagName("expires")[0].childNodes[0].nodeValue;
}
xml file:
<?xml version="1.0" encoding="utf-8"?>
<feed>
<ENTRY>
<content>
<m:properties>
<id>41</id>
<type>Hallo meneer</type>
<title>MAILING</title>
<body>Just some random content Hi !</body>
<expires>2013-07-11</expires>
</m:properties>
</content>
</ENTRY>
</feed>
and if I remove the : it works completely fine, is there anyway so I can keep the : and still read it ?