I’m experimenting with this xml:
<theFeed>
<games>
<game id="103" period="" clock="">
<team id="657" type="home" logo="1/12" score="46"/>
<team id="740" type="visitor" seed="11" score="59"/>
</game>
</games>
</theFeed>
and I’m trying to get the attribute “score” from the first child of the game node, but when I use this code(javascript):
var Hlogo = theXml.getElementsByTagName('game')[0].childNodes[0].getAttribute('score');
it crashes. I can get attributes from the parent just fine using getAttributes…
is there something I’m doing wrong?
seems to work fine, providing
theXmlis valid (which i forced it to bedocument)hope this helps -ck