Java XML NodeList getArray(NodeList nodeList)

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

Description

Returns an array version of the passed NodeList.

License

Open Source License

Declaration

public static Node[] getArray(NodeList nodeList) 

Method Source Code

//package com.java2s;
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt

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

public class Main {
    /**//  w ww .j av  a  2  s  . c o  m
     * Returns an array version of the passed NodeList. Used to work around DOM design issues.
     */
    public static Node[] getArray(NodeList nodeList) {
        Node[] nodes = new Node[nodeList.getLength()];
        for (int i = 0; i < nodeList.getLength(); i++)
            nodes[i] = nodeList.item(i);
        return nodes;
    }
}

Related

  1. findNode(NodeList nodeList, String nodeName)
  2. findNode(NodeList nodes, String nodeName)
  3. findNode(String id, NodeList orgs)
  4. findNodeByName(NodeList nodeList, String name)
  5. getAllNodes(NodeList nodeList, List nodes)
  6. getArray(NodeList nodeList)
  7. getContent(NodeList nl, String path)
  8. getCurrentListPosition(Node refNode, NodeList list)
  9. getDeepNode(String name[], NodeList nodes)