List of utility methods to do XML NodeList to Element List
List | toElementList(NodeList list) to Element List ArrayList<Element> nodes = new ArrayList<Element>(); for (int i = 0; i < list.getLength(); i++) { Node node = list.item(i); if (node instanceof Element) nodes.add((Element) node); return nodes; |
List | toElementList(NodeList nds) to Element List List<Element> list = new ArrayList<Element>(); for (int i = 0; i < nds.getLength(); i++) { Node child = nds.item(i); if (child.getNodeType() == Node.ELEMENT_NODE) { list.add((Element) child); return list; ... |
List | toElementList(NodeList nodeList) to Element List List<Element> list = new ArrayList<Element>(nodeList != null ? nodeList.getLength() : 0); if (nodeList == null) return list; int n = nodeList.getLength(); for (int i = 0; i < n; i++) { Node item = nodeList.item(i); if (item instanceof Element) list.add((Element) item); ... |
List | toElementList(NodeList nodeList) Gets all the elements out of a NodeList . List<Element> elements = new ArrayList<Element>(); for (int i = 0; i < nodeList.getLength(); i++) { Node node = nodeList.item(i); if (node instanceof Element) { elements.add((Element) node); return elements; ... |
Element[] | toElements(NodeList nl) to Elements if (nl.getLength() == 0) { return EMPTY_ELEMENTS; List<Element> al = new ArrayList<Element>(); for (int i = 0; i < nl.getLength(); i++) { Node n = nl.item(i); if (n instanceof Element) { al.add((Element) n); ... |
List | toElements(NodeList nodes) format XML into human readable form List<Element> list = new ArrayList<Element>(); for (int i = 0; i < nodes.getLength(); i++) if (nodes.item(i) instanceof Element) list.add((Element) nodes.item(i)); return list; |
List | toElements(NodeList nodes, String filter) To elements. List<Element> list = new ArrayList<Element>(); for (int i = 0; i < nodes.getLength(); i++) if (nodes.item(i) instanceof Element) { Element e = (Element) nodes.item(i); if (filter == null || e.getTagName().equals(filter)) { list.add(e); return list; |