views:

67

answers:

2

Hey,

I want to read an Atom in Flex. I can see in the debugger that he can read the Atom and that there are entries, I can see each value. So far, so good.

But when I want to assign a value from the atom to a variable, he never gives any text. It's always this: "".

My code:

ch.Name = xml.title;
ch.Desc = xml.subtitle;
ch.Updated = xml.updated;

for each(var entry:XML in xml.entry)
{                                           var fee:Feed = new Feed();
fee.Name = entry.title;
fee.Url = entry.link.@href;
fee.Desc = entry.summary;
fee.Updated = entry.updated;
fee.Published = entry.published;

ch.Children.addItem(fee);   
}

For example this is the value ch.Name gets

ch.Name = "";

But that's strange, because I can see in the debugger that it schould be "Tweakers.net". It becomes even more strange, because it works just fine with RSS.

Thanks a lot, Vincent

Sorry for my bad English.

A: 

My best is to trace each node.

Can i have a look into your resultevent and in what format you are getting it.

Vinothbabu
My evt.target.data has the format XML. I can view everything from this XML in the debugger, but when i trace everything it is empty.
Vinzcent
+2  A: 

Looks like the problem is related to xml namespaces (defined with the attribute xmlns in your atom xml).

I've never had to work with Atom so I don't have first hand experience, but I remember reading about it a couple of times.

I found this question in stackoverflow, which might get you on the right track.

Hope this helps.

Juan Pablo Califano
This is the correct answer, the linked question appears to have the same exact problem as you, and the selected answer should solver your problem.
davr
I solved it by using httpService instead of URLLoader, but this answer is maybe better.
Vinzcent