I have been working with this XML and I'm not able to get a list of the nodes with the elements operator:
<s:LinearGradient rotation="90" xmlns:s="library://ns.adobe.com/flex/spark">
<s:GradientEntry color="0x000000" alpha="0.8"/>
<s:GradientEntry color="0xFFFFFF" alpha="0.8"/>
</s:LinearGradient>
Here is my AS3:
var fillXML:XML = <s:LinearGradient rotation="90" xmlns:s="library://ns.adobe.com/flex/spark">
<s:GradientEntry color="0x000000" alpha="0.8"/>
<s:GradientEntry color="0xFFFFFF" alpha="0.8"/>
</s:LinearGradient>;
var entriesXML:XMLList;
var GRADIENT_ENTRY:String = "GradientEntry";
entriesXML = fillXML..entries;
if (entriesXML.length()==0) {
entriesXML = fillXML.descendants(GRADIENT_ENTRY);
if (entriesXML.length()==0) {
entriesXML = fillXML.elements(GRADIENT_ENTRY);
}
}
It looks like you have to search using a QName object:
var fillXML:XML = <s:LinearGradient rotation="90" xmlns:s="library://ns.adobe.com/flex/spark">
<s:GradientEntry color="0x000000" alpha="0.8"/>
<s:GradientEntry color="0xFFFFFF" alpha="0.8"/>
</s:LinearGradient>;
var entriesXML:XMLList;
var GRADIENT_ENTRY:String = "GradientEntry";
var qname:QName = new QName("library://ns.adobe.com/flex/spark", GRADIENT_ENTRY);
entriesXML = fillXML.elements(GRADIENT_ENTRY);;
if (entriesXML.length()==0) {
entriesXML = fillXML.elements(qname);
}