List of utility methods to do XML First Child Element
Element | getFirstChildElement(Element parentElem) get First Child Element if (parentElem == null) { return null; Node child = parentElem.getFirstChild(); while (child != null) { if (child.getNodeType() == Node.ELEMENT_NODE) { return (Element) child; child = child.getNextSibling(); return null; |
Element | getFirstChildElement(Element root) getFirstChildElement purpose. Node child = root.getFirstChild(); while (child != null) { if (child.getNodeType() == Node.ELEMENT_NODE) { return (Element) child; child = child.getNextSibling(); return null; ... |
Element | getFirstChildElement(final Node node) Gets the first child Element of the specified Node , if any. return getFirstChildElementInternal(node, false, null, null);
|
Element | getFirstChildElement(final Node parent, final String elemName) get First Child Element for (Node child = parent.getFirstChild(); child != null; child = child.getNextSibling()) { final short nodeType = child.getNodeType(); if (nodeType == Node.ELEMENT_NODE) { final String nodeName = child.getNodeName(); if (nodeName.equals(elemName)) { return (Element) child; return null; |
Element | getFirstChildElement(Node n) Gets the first child Element of the node, skipping any Text nodes such as whitespace. Node child = n.getFirstChild(); while (child != null && child.getNodeType() != Node.ELEMENT_NODE) { child = child.getNextSibling(); if (child != null) { return (Element) child; } else { return null; ... |
Element | getFirstChildElement(Node n, String ns, String localName) Gets the first child Element of the node of the given name, skipping any Text nodes such as whitespace. Element e = getFirstChildElement(n); while (e != null && !isElementNamed(e, ns, localName)) e = getNextSiblingElement(e); return e; |
Element | getFirstChildElement(Node node) Gets the first child org.w3c.dom.Element of the given Node .
NodeList children = null; int numChildren = 0; if (node == null || (children = node.getChildNodes()) == null || (numChildren = node.getChildNodes().getLength()) == 0) { return null; Element result = null; for (int i = 0; i < numChildren && result == null; i++) { ... |
Element | getFirstChildElement(Node node) get First Child Element Node child = node.getFirstChild(); while (child != null && child.getNodeType() != Node.ELEMENT_NODE) { child = child.getNextSibling(); return (Element) child; |
Element | getFirstChildElement(Node node) Gets the first child element of a node. node = node.getFirstChild(); while (node != null && node.getNodeType() != Node.ELEMENT_NODE) { node = node.getNextSibling(); return (Element) node; |
Node | getFirstChildElement(Node node) get First Child Element Node firstChildElement = null; for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) { if (child.getNodeType() != Node.TEXT_NODE) { firstChildElement = child; break; return firstChildElement; ... |