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 | ### getName()
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>
    //     <name>Processing</name>
    //     <url>www.processing.org</url>
    //   </site>
    // </websites>

    XMLElement xml;

    void setup() {
      size(200, 200);
      xml = new XMLElement(this, "sites.xml");
      XMLElement site = xml.getChild(0);
      XMLElement[] siteData = site.getChildren();
      String s1 = siteData[0].getName();
      String s2 = siteData[1].getName();
      println(s1 + " : " + s2);  // Prints "name : url"
    }
Description | Returns the name of the element.
Syntax |
    xml.getName()
Parameters |
xml | any variable of type XMLElement
Usage | Web & Application

Updated on November 28, 2006 12:04:04am PST