thanks PhiLho
updated code, it now passes headlines to draw, I can't seem to get it to add the description lines though.
for example a headline is:To Save Money, M.I.T. Drops 8 Sports Teams
the description that goes along with it is:High school students with dreams of competing in alpine skiing at the Massachusetts Institute of Technology, beware: when this academic year ends, the institute will no longer have a varsity team.
That squad and seven others — competitive pistol, golf, wrestling, and men and women’s ice hockey and gymnastics — were eliminated on Thursday by M.I.T.’s [...]
under the for loop, the following is not working corectly
onelongstring = onelongstring + headlines[i];
onelongstring = onelongstring + description[i];
Code:
import simpleML.*;
XMLRequest xmlRequest;
String delimiters=" ,.?!;:";
String onelongstring;
void setup() {
size(200,200);
// Creating and starting the request
// An array of XML elements can be retrieved using getElementArray.
// This only works for elements with the same name that appear multiple times in the XML document.
xmlRequest = new XMLRequest(this, "http://budget.president.ufl.edu/feed/" );
xmlRequest.makeRequest();
}
// When the request is complete
void netEvent(XMLRequest ml) {
// Retrieving an array of all XML elements inside"
title*
"tags
String[] headlines = ml.getElementArray( "title");
String[] description = ml.getElementArray( "description");
println(headlines);
int arlength=headlines.length;
String onelongstring="";
//println(onelongstring);
for (int i = 0; i < headlines.length; i++){
onelongstring = onelongstring + headlines[i];
onelongstring = onelongstring + description[i];
}
}
void draw() {
println(onelongstring);
noLoop(); // Nothing to see here
}