December 19th, 2006
Really cool E4X reference.
Today I’ve been working on a tree control that gets it’s data from an XML file. Trying to programmatically access particular XML nodes has required me to access the XML object directly (vs. accessing through the tree.)
Anyway, I ran into an issue where certain nodes had particular attributes that others did not. When searching for nodes with that attribute, using a node.(@attributeName == someVal) I was receiving a “ReferenceError: Error #1065: Variable @attributeName is not defined”…this prompted me to try to find a way to have a conditional based on the existence of this attribute within a particular XML node.
Based on the above, I realized that the E4X documentation within the Flex language ref was very sparse and I was forced to find some alternate references…using the all-knowing google, I found a really good reference for E4X…for those of you that have read this far and actually care.
How do I test if an attribute of an XML object is set?

