List of utility methods to do XML NodeList
NodeList | getNodeList(Node fatherNode, String nodeName) Gets a node list from document, given the father node and the children node name. NodeList list = null; if (((Element) fatherNode).getElementsByTagName(nodeName) != null) { list = ((Element) fatherNode).getElementsByTagName(nodeName); return list; |
NodeList | getNodeList(Node node, String tagName) get Node List return getNodeList(NodeToElement(node), tagName);
|
NodeList | getNodeList(Node pNode, String tagName) get Node List Element nodeElement = (Element) pNode;
NodeList theNodeList = nodeElement.getElementsByTagName(tagName);
return theNodeList;
|
ArrayList | getNodeList(NodeList nl, String[] names, int pos) Get the list of nodes matching the given array of tag names in the given node list if ((nl == null) || (names.length - pos == 0)) return null; if (nl.getLength() == 0) return null; ArrayList<Node> result = null; if (names.length - pos == 1) result = new ArrayList<Node>(); for (int i = 0; i < nl.getLength(); i++) { ... |
List | getNodeList(NodeList nodeList) get Node List List<Node> results = new ArrayList<Node>(); int len = nodeList.getLength(); for (int i = 0; i < len; i++) { Node node = nodeList.item(i); if (node instanceof Element) { results.add(node); } else { continue; ... |
List | getNodeList(NodeList nodeList) Method that returns only the Element objects of the specified NodeList List<Element> nodes = new ArrayList<>(); for (int i = 0; i < nodeList.getLength(); i++) { Node node = nodeList.item(i); if (node instanceof Element) nodes.add((Element) node); return nodes; |
List | getNodeListAsList(NodeList nl) get Node List As List ArrayList<Node> l = new ArrayList<Node>(); for (int i = 0; i < nl.getLength(); i++) { l.add(nl.item(i)); return l; |
List | getNodeListByName(Node node, String name, List get Node List By Name NodeList nodeList = node.getChildNodes(); System.out.println("child node name: " + node.getNodeName()); if (nodeList == null) return null; for (int i = 0; i < nodeList.getLength(); i++) { Node candNode = nodeList.item(i); if (candNode.getNodeName().equals(name)) { finalNodeList.add(candNode); ... |
List | getNodeListItems(NodeList nodeList) get Node List Items List<Node> nodes = Lists.newArrayList(); for (int i = 0; i < nodeList.getLength(); i++) { Node node = nodeList.item(i); if (node.getLocalName() != null) { nodes.add(node); return nodes; ... |
int | getNodeListLength(NodeList list) get Node List Length int length = 0; try { length = list.getLength(); } catch (NullPointerException e) { return length; |