Here you can find the source of convertToElementList(org.w3c.dom.NodeList _nodeList)
Parameter | Description |
---|---|
_nodeList | collection of nodes |
public static List<Element> convertToElementList(org.w3c.dom.NodeList _nodeList)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; import org.w3c.dom.Element; public class Main { /**/*from w w w. j a v a 2 s . c om*/ * Convert a {@link NodeList} to a Java {@link List} of {@link Element}s. * @param _nodeList collection of nodes * @return list of elements */ public static List<Element> convertToElementList(org.w3c.dom.NodeList _nodeList) { List<org.w3c.dom.Element> elemList = new ArrayList<>(); for (int i = 0; i < _nodeList.getLength(); i++) { Element elem = (org.w3c.dom.Element) _nodeList.item(i); elemList.add(elem); } return elemList; } }