Java XML NodeList getNodeListItems(NodeList nodeList)

Here you can find the source of getNodeListItems(NodeList nodeList)

Description

get Node List Items

License

Open Source License

Declaration

public static List<Node> getNodeListItems(NodeList nodeList) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import com.google.common.collect.Lists;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import java.util.List;

public class Main {
    public static List<Node> getNodeListItems(NodeList nodeList) {
        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);/*from   www.j av  a 2 s  . co  m*/
            }
        }
        return nodes;
    }
}

Related

  1. getNodeList(NodeList nl, String[] names, int pos)
  2. getNodeList(NodeList nodeList)
  3. getNodeList(NodeList nodeList)
  4. getNodeListAsList(NodeList nl)
  5. getNodeListByName(Node node, String name, List finalNodeList)
  6. getNodeListLength(NodeList list)
  7. getNodes(String tagName, NodeList nodes)
  8. getNodesByName(String name, NodeList nodeList)
  9. getNodesOfType(NodeList list, short type)