2

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?

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
Florian
  • 71
  • 8

1 Answers1

1
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.

verveguy
  • 2,103
  • 17
  • 16