Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User vadla's Avatar
    Join Date
    Mar 2012
    Posts
    1
    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
    Nokia Developer Moderator isalento's Avatar
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    832
    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. Is series 60 application support series 40 devices?
    By rohitnegi in forum Symbian C++
    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 C++
    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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved