Hi there, i have a quick query.
Is there a way to process a online xml file instead of having the xml file on your server?
I have this so far:
<!DOCTYPE html>
<html>
<body>
<script>
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","sitemap.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
document.write();
var x=xmlDoc.getElementsByTagName("url");
for (i=0;i<x.length;i++)
{
document.write(x.getElementsByTagName("priority")[0].childNodes[0].nodeValue);
document.write("</td><td>");
document.write("<br />");
}
document.write("</table>");
</script>
</body>
</html>
Obviously, this only returns the "priority" which in this case turns out like this:
1.000
0.5000
0.5000
0.5000
0.5000
0.5000
0.5000
0.5000
0.5000
0.5000
0.5000
and so on.
My question is, is there a way to change it so that i can run it to the xml online link which is:
http://www.google.co.uk/sitemap.xml
Is there a way to process a online xml file instead of having the xml file on your server?
I have this so far:
<!DOCTYPE html>
<html>
<body>
<script>
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","sitemap.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
document.write();
var x=xmlDoc.getElementsByTagName("url");
for (i=0;i<x.length;i++)
{
document.write(x.getElementsByTagName("priority")[0].childNodes[0].nodeValue);
document.write("</td><td>");
document.write("<br />");
}
document.write("</table>");
</script>
</body>
</html>
Obviously, this only returns the "priority" which in this case turns out like this:
1.000
0.5000
0.5000
0.5000
0.5000
0.5000
0.5000
0.5000
0.5000
0.5000
0.5000
and so on.
My question is, is there a way to change it so that i can run it to the xml online link which is:
http://www.google.co.uk/sitemap.xml