mardi 30 septembre 2014

Getting value from XML


Vote count:

0




This is a small part of XML.



wind_gust_mph>3.0/wind_gust_mph>

wind_kph>1.6/wind_kph>

wind_gust_kph>4.8/wind_gust_kph>


I retrieved it from http://ift.tt/1rBQCS1


The below is my code:



public MyWeather parseWeather(Document srcWunderGroundDoc){

MyWeather myWeather = new MyWeather();
Node windGust = srcWunderGroundDoc.getElementsByTagName("wind_gust_mph").item(0);
myWeather.gust = windGust.getAttributes().getNamedItem("wind_gust_mph").getNodeValue().toString();


}


When I tried to run my app and it crashed. Can someone show me how to get three tags above?






asked 1 min ago







Getting value from XML

Aucun commentaire:

Enregistrer un commentaire