XMLElement::getChildren() \ Language (API) \ Processing 1.0
Search processing.org:
Language (A-Z) \
Libraries \
Tools \
Environment \
Compare \
Troubleshooting
Reference for Processing version 1.0+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.
Class
XMLElement
Name
getChildren()
Examples
// The following short XML file called "sites.xml" is parsed
// in the code below. It must be in the project's "data" directory
// <?xml version="1.0"?>
// <websites>
// <site id="0" url="processing.org">Processing</site>
// <site id="1" url="mobile.processing.org">Processing Mobile</site>
// </websites<
XMLElement xml;
void setup() {
size(200, 200);
xml = new XMLElement(this, "sites.xml");
XMLElement[] kids = xml.getChildren();
for (int i=0; i < kids.length; i++) {
String site = kids[i].getContent();
println(site);
}
}void setup() {
// Download RSS feed of news stories from yahoo.com
String url = "http://rss.news.yahoo.com/rss/topstories";
XMLElement rss = new XMLElement(this, url);
// Get all elements
XMLElement[] links = rss.getChildren("channel/item/link");
for (int i = 0; i < links.length; i++) {
println(links[i].getContent());
}
}
Description
Returns all of the children as an XMLElement array.
When the path parameter is specified, then it will return all children that match that path. The path is a series of elements and sub-elements, separated by slashes.
Syntax
xml.getChildren()
xml.getChildren(path)
Parameters
xml
any variable of type XMLElement
Returns
XMLElement[]
Usage
Web & Application
Related
XMLElement_getChildCount()XMLElement_getChild()
Updated on February 26, 2009 08:28:43pm PST
Processing was initiated by Ben Fry and Casey Reas. It is developed by a small team of volunteers.
© Info \
Site hosted by Media Temple!
Wyszukiwarka
Podobne podstrony:
XMLElement getChildCountXMLElement getChildXMLElement getChildrenXMLElement getChildCountXMLElement getChildfunction hw getchilddoccollobjXMLElement getContentfunction hw getchilddoccollXMLElementPShape getChildXMLElement getIntAttributeXMLElement getNamefunction hw getchilddoccollfunction hw getchilddoccollfunction hw getchildcollXMLElement getStringAttributewięcej podobnych podstron