I have this xml file.
var xml:XML = <rootNode>
开发者_开发知识库 <element name="CompositeFont">
<attribute name="Self">
<data type="string"/>
</attribute>
<element name="Font">
</element>
</element>
</rootNode>;
I am getting XmlList of this xml by using
var elementList:XMLList = xml.children();
But I want these node names, example: element,attribute,element in arrayList.
["element","attribute","element"]
Please, help........ Thanks.:)
Since XmlList directly inherits Object (opposed to IList), you will have to loop over it an add each item to a new ArrayCollection.
var ac:ArrayCollection = new ArrayCollection();
for each ( var xml:XML in elementList ) {
ac.addItem(xml);
}
精彩评论