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 boolean hasChild(Element parent, String nodeName) {
        NodeList childNodes = parent.getChildNodes();
        int length = childNodes.getLength();
        for (int i = 0; i < length; i++)
            if (childNodes.item(i).getNodeName().equals(nodeName))
                return true;
        return false;
    }
}