I am having difficultly parsing an XML file using e4X. I can acquire information from the 'version' tag, but I cannot from any nested tags.
Could someone please point out what I am doing wrong?
Here is the XML:
<NameOfRoot xmlns="http://www.theaddress.com/file">
<version>1.0</version>
<NameOfChild1>
<NameOfChild2>
<GeneralData>
<Identifier>2678</Identifier>
</GeneralData>
</NameOfChild2>
</NameOfChild1>
</NameOfRoot>
Here is the code:
<mx:HTTPService id="MyService" url="data.xml" result="resultHandler(event)" resultFormat="e4x"/>
private function resultHandler(event:ResultEvent):void {
XMLData = event.result as XML;
var ver:String = XMLData.*::version; // ver = 1.0
var id:String = XMLData.*::NameOfChild1.NameofChild2.GeneralData.Identifier; //empty string
}