name
getDepth ( )
/*
This example loads a xml file and prints out its depth.
*/

import proxml.*;

XMLInOut xmlIO;

void setup(){
  size(400,400);
  
  xmlIO = new XMLInOut(this);
  xmlIO.loadElement("my-xml-file.xml");
}

void xmlEvent(XMLElement element){
  println(element.getDepth());
}

void draw(){
}
description
Use getDepth to get the maximum depth of an Element to one of its leaves.
syntax
getDepth();
returns
int, the maximum depth of an Element to one of its leaves
usage
Web & Application
related