two quick XML example fixes

This commit is contained in:
Daniel Shiffman
2013-06-03 14:31:32 -04:00
parent 5684907cd6
commit dd88eecfe9
2 changed files with 2 additions and 2 deletions

View File

@@ -94,7 +94,7 @@ void mousePressed() {
// Set the diameter element
XML diameter = bubble.addChild("diameter");
// Here for a node's content, we have to convert to a String
diameter.setContent("" + random(40,80));
diameter.setFloatContent(random(40,80));
// Set a label
XML label = bubble.addChild("label");

View File

@@ -29,7 +29,7 @@ void setup() {
XML xml = loadXML(url);
// Grab the element we want
XML forecast = xml.getChild("channel").getChild("item").getChild("yweather:forecast");
XML forecast = xml.getChild("channel/item/yweather:forecast");
// Get the attributes we want
temperature = forecast.getInt("high");