XML Returns Null
in
Programming Questions
•
2 years ago
I am working on a new project where I am going to take a weather XML feed and use temperature data from it to create an analog meter via an arduino. I am playing with the XML parsing to get the temperature, and I keep getting "null" as the return. I know I am doing something wrong but can't seem to figure it out. Ideas?
XMLElement xml;
void setup() {
size(200, 200);
String url = "http://www.google.com/ig/api?weather=NE17RU";
xml = new XMLElement(this, url);
println(xml);
XMLElement weather = xml.getChild("weather");
XMLElement current = weather.getChild("current_conditions");
String condition = current.getString("condition data");
println(condition);
}
1