Search code examples
xmlapache-flexe4xatom-feed

Why is my Atom data binding not working?


I've got a Flex application with Advanced Data Grids binded with XML and Atom feeds.

With my XML file, the application works very well:

jiraList = new XMLList(event.result.channel.item);

However, when I try to access Atom feeds, I cannot go lower than "event.result".

This works:

clarityList = event.result as XMLList;
Alert.show(clarityList.toString());

But this doesn't:

clarityList = event.result.feed as XMLList;
Alert.show(clarityList.toString());

As Adobe explains it, I use the Atom namespace:

private namespace atom = "http://www.w3.org/2005/Atom";
use namespace atom;

My goal is to be able to bind the Atom feed with my Advanced Data Grid Columns, as it works with my XML feed. How can I do this?


Solution

  • private namespace atom = "http://www.w3.org/2005/Atom";
    use namespace atom;
    
    clarityList = event.result.atom::feed as XMLList;
    Alert.show(clarityList.toString());
    

    Namespaces must be used to qualify the property (element) accesses. ActionScript property names are in fact namespace-qualified, but rarely used this way. XML tends to bring this topic "to the surface" so to speak.