List of utility methods to do XML Element Root
Element | getRoot(Document doc) get Root Node n = doc.getFirstChild(); while (n != null) { if (n instanceof Element) { return (Element) n; n = n.getNextSibling(); return null; ... |
Element | getRoot(Document doc) get Root return doc.getDocumentElement();
|
Element | getRoot(Document document) get Root return getRoot(document, "root"); |
Element | getRoot(final Document doc) Get root element of the given document. if (doc != null) return doc.getDocumentElement(); return null; |
SOAPElement | getRoot(SOAPElement e) Returns the root element of e List<SOAPElement> parents = getParents(e); int size = parents.size(); if (size > 0) { return parents.get(size - 1); } else { return e; |
Element | getRootElement(Document d) If first node found is not an element, returns null. if (d == null) { return null; NodeList list = d.getChildNodes(); if (list.getLength() <= 0) { return null; } else { Node n = list.item(0); ... |
Element | getRootElement(Document doc) Return the root Element of a Document . if (doc == null) return null; NodeList children = doc.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node node = children.item(i); if (node instanceof Element) return (Element) node; return null; |
Element | getRootElement(Document doc) Return the root element for specified document (null if not found) return getRootElement(doc, false);
|
Element | getRootElement(Document doc) get Root Element Node node = doc.getFirstChild(); while (node != null) { if (node.getNodeType() == Node.ELEMENT_NODE) return (Element) node; node = node.getNextSibling(); return null; |
Element | getRootElement(Document document) get Root Element if (document != null) { return document.getDocumentElement(); return null; |