Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

import org.w3c.dom.Document;

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

public class Main {
    public static Node findNodeByTagName(Document document, String tagName) {
        Node foundNode = null;
        NodeList nodes = document.getElementsByTagName(tagName);
        if (nodes.getLength() > 0)
            foundNode = nodes.item(0);
        return foundNode;
    }
}