Search processing.org:

Reference for Processing (BETA) version 0135+. 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

### getChildCount()

Examples

    import processing.xml.*;

    // 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$#60;/site>
    // </websites>

    XMLElement xml;

    void setup() {
      size(200, 200);
      xml = new XMLElement(this, "sites.xml");
      int numSites = xml.getChildCount();
      println(numSites); // Prints "2"
    }

Description | Returns the number of children for the element.

Syntax

    xml.getChildCount()

Parameters

xml | any variable of type XMLElement

Usage | Web & Application
Related | XMLElement_getChild() XMLElement_getChildren()

Updated on February 09, 2008 04:38:52pm PST