i have an XML response from a server that has a gazillion elements in it where
i
need to use a few of these. the required element names are defined elsewhere &
read in at run time. the XML response is something along the lines of:
<gml:featureMembers>
<topp:runoffdatapoints gml:id="runoffdatapoints.1">
<topp:UPSTREAMAREASQKM>20.8503</topp:UPSTREAMAREASQKM>
<topp:ID>13469</topp:ID>
<topp:QMCUBED>9.8567</topp:QMCUBED>
</topp:runoffdatapoints>
<<gml:featureMembers>
the namespaces are all defined ok & work fine if used statically.
for each (x in result.gml::featureMembers.topp::runoffdatapoints) {
id=x.topp::ID; // works just fine
}
but i'm having a brain freeze trying to understand how to refer to the required
elements dynamically. like
var runoffIDField:String="topp::ID";
for each (x in result.gml::featureMembers.topp::runoffdatapoints) {
id=x[runoffIDField]; // nope
id=x.child(runoffIDField); // ditto
}
i guess the namespace is playing havoc w/this.
anyone have any ideas or references?
thanks.