Can you post an example for XML and code for selecting node form it?
Thanks for your answer! The following is a very simple example of the XML a user would have i a standard situation (it is generated at runtime):
<Class label="Geographical Location">
<Individual label="Land of Israel"/>
Now, let's assume that I want to select the "Class" node of the "Individual" whose label is "Rome". One way to do this by using e4x in as3 is:
var individualClass:XML = myXML..Individual.(@label == 'Rome').parent();
I put the double dot ".." after myXML because I don't know at what level the individual I'm trying to select is going to be. Anyway, this kind of syntax works correctly everywhere in my application but in a component. I checked everything I could think of. What I'va noticed is that apparently no kind of condition in parenthesis would work. If I write for instance:
var individualClasses:XMLList = myXML..Individual;
it correctly returns an XMLList containing all the "Individual" nodes. Any node in the XMLList is the selectable by specifing the node position by using the array-like syntax ("[n]"). However, as soon as I put a condition in parenthesis the command returns a null object, whatever the condition. There must be a reason why this is happening, but I just can't think to anything besides what I have alredy tryed. I already have a workaround for this, but I'm very courious to know what is going on here.
Check if all Individual nodes has label property.
All properties used if e4x conditions should be in all nodes.
yes, they do, no doubt on this. And, by the way, if they didn't, Flex would have fired an error, which is not the case. The mystery gets darker and darker...