is s40 series support XML parsing?
Hi
how to parse an XML document i.e stored in remote location
url="http://www.google.com/ig/api?weather=delhi".
i am trying to parse this XML document with the fallowing code,but i am not able to display the parsed content
// fetchReport is my java script function
function fetchReport(city)
{
url="http://www.google.com/ig/api?weather="+city;
alert(url);
request=new XMLHttpRequest();
alert("XMLHttpRequest created");
request.open('GET', url, true);
alert("Connection established");
request.send();
alert(" XMLHttpRequest request send ");
request.onreadystatechange=function()
{
if(request.readyState==4 && request.status==200)
{
alert(request.responseText);
xmlDoc=loadXMLString(request.responseText);
document.getElementById("content").innerHTML=xmlDoc.getElementsByTagName("forecast_information")[0].childNodes[0].nodeValue;
}
};
}
function loadXMLString(txt)
{
alert("inside loadXMLString");
if (window.DOMParser)
{
parser=new DOMParser();
xmlDoc=parser.parseFromString(txt,"text/xml");
}
else // Internet Explorer
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.loadXML(txt);
}
return xmlDoc;
}
please let me know whether s40 series will support xml parsing ar not.
Re: is s40 series support XML parsing?
Hi and welcome to forum!
Yes, Series 40 Web Apps do support XML parsing.
Please see this thread for explanation why Google Weather API does not work:
[url]http://www.developer.nokia.com/Community/Discussion/showthread.php?234138-Using-Googel-Weather-API-for-weather-Info[/url]
Br,
Ilkka