0

Parsing Weather RSS feed

I am trying to parse the Weather RSS feed. What I am trying to do is store the text attribute of yweather:condition into a variable. I am using both javascript and Jquery. So far I have been unsuccessful. Any suggestions would be appreciated.

by
2 Replies
  • You must be aware of the so called Namespace "yweather", which is defined in the xml document's header. There are also special javascript methods to retrieve data through namespace tags [getDocumentByTagNS(namespace, tag) ]
    0
  • This is the javascript code which uses the jQuery library. I tried with the following code and was able to retrieve the value from the specific tag.

    CODE
    $.ajax({
    type: "GET",
    url: "test.xml",
    dataType: "xml",
    success: function(xml) {
    $(xml).find('yweather\\:condition').each(function(){
    var text_attr = $(this).attr('text');
    alert ( "text attribute : " + text_attr );

    });
    }


    Thanks,
    Robyn
    0
This forum is locked.

Recent Posts

in YDN Documentation