Ok so I have the following from Yahoo Weather:
And I'm trying to drill down to the data in the attributes of yweather.Code:<?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> <title>Yahoo! Weather - Marietta, GA</title> <link>http://us.rd.yahoo.com/dailynews/rss/weather/Marietta__GA/*http://weather.yahoo.com/forecast/30062_f.html</link> <description>Yahoo! Weather for Marietta, GA</description> <language>en-us</language> <lastBuildDate>Wed, 13 May 2009 7:55 pm EDT</lastBuildDate> <ttl>60</ttl> <yweather:location city="Marietta" region="GA" country="US"/> <yweather:units temperature="F" distance="mi" pressure="in" speed="mph"/> <yweather:wind chill="68" direction="80" speed="5" /> <yweather:atmosphere humidity="68" visibility="10" pressure="30.18" rising="2" /> <yweather:astronomy sunrise="6:38 am" sunset="8:31 pm"/> <image> <title>Yahoo! Weather</title> <width>142</width> <height>18</height> <link>http://weather.yahoo.com</link> <url>http://l.yimg.com/a/i/us/nws/th/main_142b.gif</url> </image> <item> <title>Conditions for Marietta, GA at 7:55 pm EDT</title> <geo:lat>33.96</geo:lat> <geo:long>-84.53</geo:long> <link>http://us.rd.yahoo.com/dailynews/rss/weather/Marietta__GA/*http://weather.yahoo.com/forecast/30062_f.html</link> <pubDate>Wed, 13 May 2009 7:55 pm EDT</pubDate> <yweather:condition text="Mostly Cloudy" code="28" temp="68" date="Wed, 13 May 2009 7:55 pm EDT" /> <description><![CDATA[ <img src="http://l.yimg.com/a/i/us/we/52/28.gif"/><br /> <b>Current Conditions:</b><br /> Mostly Cloudy, 68 F<BR /> <BR /><b>Forecast:</b><BR /> Wed - Partly Cloudy. High: 73 Low: 60<br /> Thu - AM Clouds/PM Sun. High: 80 Low: 63<br /> <br /> <a href="http://us.rd.yahoo.com/dailynews/rss/weather/Marietta__GA/*http://weather.yahoo.com/forecast/USGA0353_f.html">Full Forecast at Yahoo! Weather</a><BR/> (provided by The Weather Channel)<br/> ]]></description> <yweather:forecast day="Wed" date="13 May 2009" low="60" high="73" text="Partly Cloudy" code="29" /> <yweather:forecast day="Thu" date="14 May 2009" low="63" high="80" text="AM Clouds/PM Sun" code="30" /> <guid isPermaLink="false">30062_2009_05_13_19_55_EDT</guid> </item> </channel> </rss><!-- api1.weather.re4.yahoo.com compressed/chunked Wed May 13 17:50:33 PDT 2009 -->
I've worked out that yweather is an XMLList and have managed to get just the yweather node but how can I then get the attributes. Every variation I've tried I get nothing.


Reply With Quote