Here you can find the source of findElementsIgnoreCase(String name, NodeList nodes)
Parameter | Description |
---|---|
name | a parameter |
nodes | a parameter |
public static LinkedList<Element> findElementsIgnoreCase(String name, NodeList nodes)
//package com.java2s; /**/*from w ww. jav a 2 s .c om*/ * * This file is part of SavoyCraft. * * SavoyCraft is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * SavoyCraft is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with SavoyCraft. If not, see <http://www.gnu.org/licenses/>. * */ import java.util.LinkedList; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { /** * Returns a list (possibly empty) with any Elements in the list of nodes * with the given name (case insensitive). * * @param name * @param nodes * @return a list; never null */ public static LinkedList<Element> findElementsIgnoreCase(String name, NodeList nodes) { LinkedList<Element> found = new LinkedList<Element>(); for (int i = 0; i < nodes.getLength(); i++) { Node n = nodes.item(i); if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase(name)) { found.add((Element) n); } } return found; } }