views:

125

answers:

1

Well that's the problem. Creating an RSS reader. One feature is that should parse several "category" nodes from a feed. But when I load a feed, the category doesn't shows up in the text area. Flash returns no errors.

Heres the code -

var curStory = rssXML.channel.item[evt.target.selectedIndex]
var  catlist:XMLList  =  curStory.category;
taLog.htmlText =   curStory.description + catlist[1];

Note - 'curStory.description' parses fine without 'catlist[1]', and trace returns the value I want.

Thanks.

A: 

It seems like you're missing on namespaces.

var ns:Namespace = new Namespace("http://www.w3.org/2005/Atom");
var curStory = rssXML.ns::channel.ns::item[evt.target.selectedIndex]
var  catlist:XMLList  =  curStory.ns::category;
taLog.htmlText =   curStory.ns::description + catlist[1];

Or you can use the default xml namespace and continue with the existing code:

default xml namespace = new Namespace("http://www.w3.org/2005/Atom");
var curStory = rssXML.channel.item[evt.target.selectedIndex]
var  catlist:XMLList  =  curStory.category;
taLog.htmlText =   curStory.description + catlist[1];
Amarghosh