我想阅读使用ActionScript 2.0ActionScript 2.0中读取XML文件
一个XML文件中的问题是,我只能让我的代码通过引用它们的位置读取标签的价值。
例如 var currentIcon = myXML.firstChild.firstChild.childNodes[0].firstChild;
如何从XMl文件引用标签名称检索值?
例如 var currentIcon = myXML.firstChild.firstChild.childNodes['icon'].firstChild;
这是我的XML文件...
<weather>
<current>
<icon>Partly cloudy</icon>
<temphigh>33</temphigh>
<templow>24</templow>
<humhigh>55</humhigh>
<humlow>95</humlow>
</current>
<forecast1>
<day>Monday</day>
<icon>rss_ts2</icon>
<temphigh>33</temphigh>
<templow>24</templow>
</forecast1>
<forecast2>
<day>Tuesday</day>
<icon>rss_ts2</icon>
<temphigh>32</temphigh>
<templow>23</templow>
</forecast2>
<forecast3>
<day>Wednesday</day>
<icon>rss_ts2</icon>
<temphigh>32</temphigh>
<templow>23</templow>
</forecast3>
</weather>
也有几个AS2 XML->的OBJ解析器上http://proto.layer51.com/ – ocodo 2011-02-14 04:09:42