List of utility methods to do XML Child Get by Type
Node | getChildByType(Element element, short nodeType) Returns first of the element's child nodes that is of type nodeType. if (element == null) return null; NodeList nodes = element.getChildNodes(); if (nodes == null || nodes.getLength() < 1) return null; Node node; String data; for (int i = 0; i < nodes.getLength(); i++) { ... |
Node | getChildByType(Node root, int type) get Child By Type NodeList nodeList = root.getChildNodes(); int count = (nodeList != null ? nodeList.getLength() : 0); for (int i = 0; i < count; i++) { Node child = nodeList.item(i); if (child.getNodeType() == type) return child; return null; ... |