Java XML Node Find findElementByTag(Set nodes, String tag)

Here you can find the source of findElementByTag(Set nodes, String tag)

Description

find Element By Tag

License

Open Source License

Declaration

public static Node findElementByTag(Set<Node> nodes, String tag) 

Method Source Code

//package com.java2s;
// License as published by the Free Software Foundation; either

import java.util.Set;
import org.w3c.dom.Node;

public class Main {
    public static Node findElementByTag(Set<Node> nodes, String tag) {
        Node result = null;/*from   ww  w. jav  a  2 s  .c  om*/

        for (Node child : nodes) {
            if (tag.equals(child.getNodeName())) {
                result = child;
                break;
            }
        }

        return result;
    }
}

Related

  1. findElement(Node node, String tagName)
  2. findElement(Node startNode, String name, String namespace)
  3. findElementById(Node head, String id)
  4. findElementById(Node node, String id)
  5. findElementByName(Node node, final String name)
  6. findElementNodeByName(Node node, String name)
  7. findElements(Node fromnode, String name)
  8. findElementsByName(Node node, List elements, String name)
  9. findNode(Document source, Element n)