I find it difficult to parse an XML file using e4X. I can get the information from the 'version' tag, but I cannot use any nested tags.
Can someone point out what I'm 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;
var id:String = XMLData.*::NameOfChild1.NameofChild2.GeneralData.Identifier;
}
user180836
source
share