×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    1

    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.

  2. #2
    Super Contributor
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    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:
    http://www.developer.nokia.com/Commu...r-weather-Info

    Br,
    Ilkka

Similar Threads

  1. Replies: 1
    Last Post: 2010-08-28, 07:44
  2. Replies: 12
    Last Post: 2010-03-21, 19:25
  3. Series 60 SDK 1.0 for Symbian OS, xml parsing
    By alokkumarsingh in forum Symbian
    Replies: 0
    Last Post: 2004-03-19, 06:53

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •