Java XML NodeList getNodeFromNodeList(NodeList list, String name)

Here you can find the source of getNodeFromNodeList(NodeList list, String name)

Description

get Node From Node List

License

LGPL

Declaration

protected static Node getNodeFromNodeList(NodeList list, String name) 

Method Source Code

//package com.java2s;
/*/*from   ww  w .ja v a  2 s  .c  o  m*/
 * @author     kebin, ucchy
 * @license    LGPLv3
 * @copyright  Copyright kebin, ucchy 2013
 */

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

public class Main {

    protected static Node getNodeFromNodeList(NodeList list, String name) {

        for (int i = 0; i < list.getLength(); i++) {
            Node node = list.item(i);
            if (node.getNodeName().equals(name)) {
                return node;
            }
        }
        return null;
    }
}

Related

  1. getMetaScriptType(List metaNodeList)
  2. getMethodNames(NodeList methodNodes)
  3. getNode(NodeList nodes, String tagName)
  4. getNode(String tagName, NodeList nodes)
  5. getNodeByNodeName(NodeList nodes, String nodeName)
  6. getNodeFromNodeList(NodeList nl, String nodeName, int index)
  7. getNodeFromNodeList(NodeList nodeList)
  8. getNodeIntValue(String tagName, NodeList nodes)
  9. getNodeList(Element from, String elementName)