List of utility methods to do XML Node Child Get
Node | getChild(Node node, String tag) get Child if (node == null) { return null; NodeList childNodes = node.getChildNodes(); if (childNodes == null) { return null; for (int i = 0; i < childNodes.getLength(); i++) { ... |
Node | getChild(Node node, String tag) get Child if (node == null) { return null; NodeList childNodes = node.getChildNodes(); if (childNodes == null) { return null; for (int i = 0; i < childNodes.getLength(); i++) { ... |
Node | getChild(Node node, String tag) get Child if (node == null) { return null; NodeList childNodes = node.getChildNodes(); if (childNodes == null) { return null; for (int i = 0; i < childNodes.getLength(); i++) { ... |
Node | getChildElement(Node element, String childNodeName) get Child Element for (int i = 0; i < element.getChildNodes().getLength(); i++) { Node child = element.getChildNodes().item(i); if (child.getNodeName().equals(childNodeName)) { return child; return null; |
Node | getChildElement(Node element, String childNodeName) get Child Element for (int i = 0; i < element.getChildNodes().getLength(); i++) { Node child = element.getChildNodes().item(i); if (child.getNodeName().equals(childNodeName)) { return child; return null; |
String | getChildElementText(Node element, String childNodeName) get Child Element Text Node child = getChildElement(element, childNodeName); if (child != null) { return child.getTextContent(); return null; |
String | getChildElementText(Node element, String childNodeName) get Child Element Text Node child = getChildElement(element, childNodeName); if (child != null) { return child.getTextContent(); return null; |
Collection | getChildElements(Node node) get Child Elements List elements = new ArrayList(); NodeList nodes = node.getChildNodes(); for (int i = 0; i < nodes.getLength(); i++) { Node childNode = nodes.item(i); if (childNode instanceof Element) { elements.add(childNode); return elements; |
List | getChildElementsByName(Element parent, String name) get Child Elements By Name List<Element> result = new ArrayList<Element>(); NodeList childNodes = parent.getChildNodes(); for (int i = 0; i < childNodes.getLength(); i++) { Node child = childNodes.item(i); if (child.getNodeType() != Node.ELEMENT_NODE) { continue; String nodeName = child.getNodeName(); ... |
Node[] | getChildNodes(Node node, short type) get Child Nodes NodeList children = node.getChildNodes(); if (children == null) return new Node[0]; List<Node> elnodelist = new ArrayList<Node>(); int i, n = children.getLength(); Node childnode; for (i = 0; i < n; ++i) { childnode = children.item(i); ... |