Java XML NodeList getNode(NodeList nodes, String tagName)

Here you can find the source of getNode(NodeList nodes, String tagName)

Description

get Node

License

Apache License

Declaration

static Node getNode(NodeList nodes, String tagName) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

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

public class Main {
    static Node getNode(NodeList nodes, String tagName) {
        for (int x = 0; x < nodes.getLength(); x++) {
            Node node = nodes.item(x);
            if (node.getNodeName().equalsIgnoreCase(tagName)) {
                return node;
            }//from w w  w . j  ava 2s. c o m
        }

        return null;
    }
}

Related

  1. getFirstNodeValue(NodeList nodeList)
  2. getFirstTextValueFromNodeList(NodeList nList)
  3. getFirstValue(NodeList nodes)
  4. getMetaScriptType(List metaNodeList)
  5. getMethodNames(NodeList methodNodes)
  6. getNode(String tagName, NodeList nodes)
  7. getNodeByNodeName(NodeList nodes, String nodeName)
  8. getNodeFromNodeList(NodeList list, String name)
  9. getNodeFromNodeList(NodeList nl, String nodeName, int index)