789
456
123
0.Enter
Debug.write("Load timed out for request: " + this.getDataset().req);
Debug.write("Error: " + this.getDataset().getErrorString());
Debug.write("HTTP status: " + this.getDataset().getStatusCode());
if (this.getDataset().getStatusCode() != 200) {
return;
}
Debug.write("Load time: " + this.getDataset().getLoadTime());
Debug.write("Date: " +
this.getDataset().getResponseHeader('date'));
// Go to the root, get second 'day' node, get 'test' node's text
Debug.write("Test: " + this.runXPath('/weather[1]/forecast[1]/day[2]@temp'));
// Relative to the last position, back out twice (to 'forecast'), get
// third 'day' node's 'temp' attribute
Debug.write("Day 3 Temperature: " + this.runXPath('../day[3]@temp'));
// Relative to the last position, back out twice (to root), get
// (first) radar node's 'src' attribute
Debug.write("Radar src: " + this.runXPath('../../radar[1]@src'));
// Relative to the last position, back out once (to root), get
// all attributes as object
var x = this.runXPath('../forecast[1]/day[1]@*');
// Look up 'temp' attribute
Debug.write("Day 1 Temperature: " + x["temp"]);
Debug.write("Root src: " + this.runXPath("/weather[1]@sourceurl"));