Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import org.w3c.dom.Element;

import org.w3c.dom.NodeList;

public class Main {
    public static Element getChildByTagName(Element e, String tagname) {
        if (e == null) {
            return null;
        }

        NodeList children = e.getElementsByTagName(tagname);

        if ((children == null) || (children.getLength() == 0)) {
            return (null);
        }

        return ((Element) children.item(0));
    }
}