I am not terribly saavy with XML parsing and am trying to
format a simple RSS feed from Yahoo! Weather.
The problem I am having is with the 3 namespaces:
yweather:condition and the two yweather:forecast nodes. I know how
to print out all the other parts of the XML but when it comes to
the namespaces I don't understand how to access their attributes.
For the other items in the XML document I am using:
xmlfile.rss.channel.item.description.xmltext which is simple
enough.
Can someone please tell me how to access the attributes of
the yweather nodes?
Thanks in advance!
Here is a short version of the XML below:
<?xml version="1.0" encoding="UTF-8" standalone="yes"
?>
<rss version="2.0" xmlns:yweather="
http://xml.weather.yahoo.com/ns/rss/1.0"
xmlns:geo="
http://www.w3.org/2003/01/geo/wgs84_pos#">
<channel>
<item>
<yweather:condition text="Fair" code="34" temp="67"
date="Tue, 22 Aug 2006 10:36 am CDT" />
<yweather:forecast day="Tue" date="22 Aug 2006" low="61"
high="79" text="Sunny" code="32" />
<yweather:forecast day="Wed" date="23 Aug 2006" low="64"
high="80" text="Scattered Thunderstorms" code="38" />
</item>
</channel>
</rss>