I just started using AS3 for my first project, and I’m pretty sure I’m already in over my head. It’s a widget that pulls in several XML/RSS feeds, one of which is from a weather vendor. Their feed starts:
<?xml version="1.0" ?>
<adc_database xmlns="http://www.aweathervendor.com">
<updated>5/30/2008 1:55:00 PM UTC</updated>
<units>
<temp>F</temp>
<dist>Miles</dist>
<speed>mph</speed>
<pres>in</pres>
<prec>in</prec>
</units>
</adc_database>
I had trouble parsing that out, until I manually edited the feed and removed the namespace attribute. Wow – did that ever affect things in AS2? I can’t remember – don’t know enough about 'em.
Thankfully, I found a thread in here that solved the problem, but…
…I don’t know what I did. Can someone explain the syntax in the code that I used to trace/capture the nodes I needed to use?
This didn’t work:
_oWxData.current_temp = e.target.oXML.currentconditions.temperature;
This worked (the namespace compensation):
_oWxData.current_temp = e.target.oXML.*::currentconditions.temperature;
What did I do with E4X in the second part?
Thanks,
IronChefMorimoto