protected XML[] getChildrenRecursive(String[] items, int offset) { if (offset == items.length-1) { return getChildren(items[offset]); } XML[] matches = getChildren(items[offset]); XML[] outgoing = new XML[0]; for (int i = 0; i < matches.length; i++) { XML[] kidMatches = matches[i].getChildrenRecursive(items, offset+1); outgoing = (XML[]) PApplet.concat(outgoing, kidMatches); } return outgoing; }
protected XML[] getChildrenRecursive(String[] items, int offset) { if (offset == items.length-1) { return getChildren(items[offset]); } XML[] matches = getChildren(items[offset]); XML[] outgoing = new XML[0]; for (int i = 0; i < matches.length; i++) { XML[] kidMatches = matches[i].getChildrenRecursive(items, offset+1); outgoing = (XML[]) PApplet.concat(outgoing, kidMatches); } return outgoing; }
return getChildrenRecursive(PApplet.split(name, '/'), 0);
return getChildrenRecursive(PApplet.split(name, '/'), 0);