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 getElement2(Element parentElement, String nodeName) {
        Node node = parentElement.getFirstChild();
        while (null != node) {
            if ((Element.ELEMENT_NODE == node.getNodeType()) && (nodeName.equals(node.getNodeName()))) {
                return (Element) node;
            }
            node = node.getNextSibling();
        }
        return null;
    }
}