Java XML NodeList createRealNodeList(NodeList nodeList)

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

Description

create Real Node List

License

Open Source License

Declaration

protected static List<Node> createRealNodeList(NodeList nodeList) 

Method Source Code


//package com.java2s;
//  it under the terms of the GNU Lesser General Public License as published by

import java.util.LinkedList;
import java.util.List;

import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class Main {
    protected static List<Node> createRealNodeList(NodeList nodeList) {
        List<Node> realNodeList = new LinkedList<Node>();
        if (null != nodeList && nodeList.getLength() > 0) {
            for (int i = 0; i < nodeList.getLength(); ++i) {
                Node nextNode = nodeList.item(i);
                realNodeList.add(nextNode);
            }/*w  w w.ja  va 2  s.c  o m*/
        }
        return realNodeList;
    }
}

Related

  1. convertToArray(NodeList e)
  2. convertToArray(NodeList list)
  3. convertToElementList(org.w3c.dom.NodeList _nodeList)
  4. copyNodeList(NodeList nodeList)
  5. createNodeCollection(final NodeList nodeList)
  6. equalNodes(NodeList sourceNodeList, NodeList targetNodeList)
  7. extractElementsFromNodeList(NodeList config, String tag, boolean required)
  8. extractNodeListFromElement(Element config, String tag, boolean required)
  9. fillHashtable(NodeList list, Hashtable fillIn)