List of utility methods to do XML Child Get
List | getChildElements(final Element element, final String namespace, final String tagName) Obtains the list of child elements with the specified tag name inside the specific namespace. final List<Element> elements = getElementList(element); final int numElements = elements.size(); final List<Element> childElements = new ArrayList<Element>(); for (int i = 0; i < numElements; i++) { final Element childElement = elements.get(i); String childTagName = childElement.getTagName(); final String childPrefix = childElement.getPrefix(); final String childNamespace = (childPrefix != null ? childElement.lookupNamespaceURI(childPrefix) ... |
List | getChildElements(final Element elm) Get all child elements for the element List<Element> elements = new ArrayList<Element>(); NodeList childs = elm.getChildNodes(); for (int i = 0; i < childs.getLength(); i++) { Node child = childs.item(i); if (child instanceof Element) { elements.add((Element) child); return elements; |