/** * Get a child by its name or path. * * @param name element name or path/to/element * @return the first matching element or null if no match */ public XML getChild(String name) { if (name.length() > 0 && name.charAt(0) == '/') { throw new IllegalArgumentException("getChild() should not begin with a slash"); } if (name.indexOf('/') != -1) { return getChildRecursive(PApplet.split(name, '/'), 0); } int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { XML kid = getChild(i); String kidName = kid.getName(); if (kidName != null && kidName.equals(name)) { return kid; } } return null; }
/** * Get a child by its name or path. * * @param name element name or path/to/element * @return the first matching element */ public XML getChild(String name) { if (name.length() > 0 && name.charAt(0) == '/') { throw new IllegalArgumentException("getChild() should not begin with a slash"); } if (name.indexOf('/') != -1) { return getChildRecursive(PApplet.split(name, '/'), 0); } int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { XML kid = getChild(i); String kidName = kid.getName(); if (kidName != null && kidName.equals(name)) { return kid; } } return null; }
return new XML[] { getChild(Integer.parseInt(name)) }; int childCount = getChildCount(); XML[] matches = new XML[childCount]; int matchCount = 0;
return new XML[] { getChild(Integer.parseInt(name)) }; int childCount = getChildCount(); XML[] matches = new XML[childCount]; int matchCount = 0;
int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { XML kid = getChild(i);
int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { XML kid = getChild(i);
int cellKids = cell.getChildCount(); if (cellKids != 0) { XML[] paragraphElements = cell.getChildren("text:p");
int cellKids = cell.getChildCount(); if (cellKids != 0) { XML[] paragraphElements = cell.getChildren("text:p");