I have made a simple demo weather app in android for the learning purpose,I have 1 api(yahoo weather api) for data to be parsed out from it,can any buddy tell me how to get "code" value for the "yweather;forecast" xml tag for every day? My api lik is yahoo weather api My xml is as below: weather:
<?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 - Dubai, AE</title>
<link>http://us.rd.yahoo.com/dailynews/rss/weather/Dubai__AE/*http://weather.yahoo.com/forecast/AEXX0004_f.html</link>
<description>Yahoo! Weather for Dubai, AE</description>
<language>en-us</language>
<lastBuildDate>Fri, 03 Jan 2014 7:58 am GST</lastBuildDate>
<ttl>60</ttl>
<yweather:location city="Dubai" region="" country="United Arab Emirates"/>
<yweather:units temperature="F" distance="mi" pressure="in" speed="mph"/>
<yweather:wind chill="63" direction="180" speed="3" />
<yweather:atmosphere humidity="77" visibility="6.21" pressure="30.18" rising="1" />
<yweather:astronomy sunrise="7:03 am" sunset="5:38 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/brand/purplelogo//uh/us/news-wea.gif</url>
</image>
<item>
<title>Conditions for Dubai, AE at 7:58 am GST</title>
<geo:lat>25.27</geo:lat>
<geo:long>55.31</geo:long>
<link>http://us.rd.yahoo.com/dailynews/rss/weather/Dubai__AE/*http://weather.yahoo.com/forecast/AEXX0004_f.html</link>
<pubDate>Fri, 03 Jan 2014 7:58 am GST</pubDate>
<yweather:condition text="Fair" code="34" temp="63" date="Fri, 03 Jan 2014 7:58 am GST" />
<description><![CDATA[
<img src="http://l.yimg.com/a/i/us/we/52/34.gif"/><br />
<b>Current Conditions:</b><br />
Fair, 63 F<BR />
<BR /><b>Forecast:</b><BR />
Fri - Sunny. High: 73 Low: 61<br />
Sat - Sunny. High: 73 Low: 58<br />
Sun - Sunny. High: 75 Low: 62<br />
Mon - AM Clouds/PM Sun. High: 76 Low: 62<br />
Tue - Scattered Showers. High: 69 Low: 59<br />
Wed - Partly Cloudy. High: 73 Low: 58<br />
Thu - Partly Cloudy. High: 72 Low: 58<br />
<br />
<a href="http://us.rd.yahoo.com/dailynews/rss/weather/Dubai__AE/*http://weather.yahoo.com/forecast/AEXX0004_f.html">Full Forecast at Yahoo! Weather</a><BR/><BR/>
(provided by <a href="http://www.weather.com" >The Weather Channel</a>)<br/>
]]></description>
<yweather:forecast day="Fri" date="3 Jan 2014" low="61" high="73" text="Sunny" code="32" />
<yweather:forecast day="Sat" date="4 Jan 2014" low="58" high="73" text="Sunny" code="32" />
<yweather:forecast day="Sun" date="5 Jan 2014" low="62" high="75" text="Sunny" code="32" />
<yweather:forecast day="Mon" date="6 Jan 2014" low="62" high="76" text="AM Clouds/PM Sun" code="30" />
<yweather:forecast day="Tue" date="7 Jan 2014" low="59" high="69" text="Scattered Showers" code="39" />
<yweather:forecast day="Wed" date="8 Jan 2014" low="58" high="73" text="Partly Cloudy" code="30" />
<yweather:forecast day="Thu" date="9 Jan 2014" low="58" high="72" text="Partly Cloudy" code="30" />
<guid isPermaLink="false">AEXX0004_2014_01_09_7_00_GST</guid>
</item>
</channel>
</rss>
<!-- fan474.sports.gq1.yahoo.com Fri Jan 3 04:36:49 PST 2014 -->
please help me for it
Hope these Link help you
1- https://www.google.co.in/?gws_rd=cr&ei=SWbGUuSSMorkrAePmYDIBA#q=how+to+get+xml+attribute+in+android+sax+parsing
2- Parse Xml to get attribute value in android using android SAX packages mathods