Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
// are made available under the terms of the Eclipse Public License v1.0

import org.w3c.dom.Element;

import org.w3c.dom.NodeList;

public class Main {
    public static Element getFirstChild(Element tag, String childTagName) {
        NodeList nodes = tag.getElementsByTagName(childTagName);
        if (nodes == null || nodes.getLength() == 0) {
            return null;
        }

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