Java XML NodeList toNodeArray(NodeList list)

Here you can find the source of toNodeArray(NodeList list)

Description

to Node Array

License

Open Source License

Declaration

public static Node[] toNodeArray(NodeList list) 

Method Source Code

//package com.java2s;

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

public class Main {
    public static Node[] toNodeArray(NodeList list) {
        int length = list.getLength();
        if (length > 0) {
            Node[] array = new Node[length];
            for (int i = 0; i < length; i++) {
                array[i] = list.item(i);
            }//w ww.j  a  v  a  2s  .c  o  m
            return array;
        }
        return null;
    }
}

Related

  1. toElementIterable(NodeList nodeList)
  2. toList(final NodeList aList)
  3. toList(final NodeList nodeList)
  4. toList(final NodeList nodes)
  5. toList(NodeList nodes)
  6. toNodeArray(NodeList list)
  7. toStream(final NodeList nodeList)
  8. toStream(NodeList nodeList)