Loading XML into Flex AS3

Bidobalobluby

New Member
I am trying to be able to load all XML data from an XML document and have been failing all night on it even with researchHere is a snippet of the XML I am trying to load:\[code\]<?xml version="1.0"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <id>urn:uuid:5762c9e8-4e65-3b0c-83b3-7874683f3dbe</id> <link href="http://stackoverflow.com/v1/espi_third_party_batch_feed" rel="self"> </link> <title type="text">Opower ESPI Third Party Batch Feed v1</title> <updated>2012-04-03T22:55:36.364Z</updated> <entry> <id>urn:uuid:baa6a50a-1306-3680-80a4-51d228db8f25</id> <link href="http://stackoverflow.com/v1/User/3560606/UsagePoint/6403112/MeterReading/1/IntervalBlock/1" rel="self"> </link> <content type="xml"> <IntervalBlock xmlns="http://naesb.org/espi"> <interval> <duration>3600</duration> <start>1299128400</start> </interval> <IntervalReading> <timePeriod> <duration>3600</duration> <start>1299128400</start> </timePeriod> <value>436</value> </IntervalReading> </IntervalBlock> </content> </entry></feed>\[/code\]Here is a snippet of the AS3 code I am puzzled on in the XmlLoader:\[code\] public function returnArray():Array { var ATOM:Namespace = new Namespace("http://www.w3.org/2005/Atom"); var NAESB:Namespace = new Namespace("http://naesb.org/espi"); trace("entered returnArray"); var tempArray:Array = new Array(); var x:Number = 0; var y:Number = 0; var entries = this.docXML.ATOM::entry; trace(entries.length()); //returns 4 and supposed to trace(entries[3].content.length()); //returns 0 supposed to return 1 trace(this.docXML.ATOM::entry[3].content.NAESB::interval.length()); //returns 0`enter code here`\[/code\]
 
Back
Top