Given a very basic xml structure and a generic Object declaration with a property already defined (location), how can I add the nodes of the xml structure (id & name) to the object's properties without statically referencing the names of the nodes?
XML:
<record>
<id><![CDATA[SS001]]></id>
<name><![CDATA[SubstationName]]></name>
</record>
ActionScript Object Declaration:
var dataHolder:Object = {location: "Far Away"};
Desired Result:
trace(dataHolder.location); // returns "Far Away"
trace(dataHolder.id); // returns "SS001"
trace(dataHolder.name); // returns "SubstationName"
The number and names of the nodes inside the xml structure will change dynamically. This is why I can not simply statically reference them.
Thanks in advance,
Peter Hanneman