Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import org.w3c.dom.*;

public class Main {
    public static Element getElementByTagName(Document document, String element) {
        NodeList nodeList = document.getElementsByTagName(element);
        if (nodeList.getLength() > 0) {
            return (Element) nodeList.item(0);
        } else {
            return null;
        }
    }
}