Android XML parser value




<current>
<city id="1839071" name="Hoko">
<coord lon="129.34" lat="36.01"/>
<country>KR</country>
<sun rise="2014-12-24T22:31:10" set="2014-12-25T08:14:18"/>
</city>
**<temperature value="3.964" min="3.964" max="3.964" unit="celsius"/>**
<humidity value="100" unit="%"/>
<pressure value="1031.09" unit="hPa"/>
<wind>
<speed value="9.71" name="Fresh Breeze"/>
<direction value="307.001" code="NW" name="Northwest"/>
</wind>
<clouds value="0" name="clear sky"/>
<visibility/>
<precipitation mode="no"/>
<weather number="800" value="Sky is Clear" icon="01d"/>
<lastupdate value="2014-12-25T07:46:40"/>
</current>


------------------------------------------------------enter code here


I want to get the value of this part.



**<temperature value="3.964" min="3.964" max="3.964" unit="celsius"/>**

Weather_temperature = parser.getAttributeValue(null, "value");


Is that correct?


No comments:

Post a Comment