Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import org.w3c.dom.NodeList;

public class Main {
    public static org.w3c.dom.Element getFirstElement(String name, org.w3c.dom.Element root) {
        NodeList list = root.getElementsByTagName(name);
        if (list != null) {
            return (org.w3c.dom.Element) list.item(0);
        } else
            return null;
    }
}