Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class Main {
    public static Node getChildNode(String name, Node node) {
        if (node == null) {
            return null;
        }
        NodeList list = node.getChildNodes();
        for (int i = 0; i < list.getLength(); i++) {
            Node no = list.item(i);
            if (no.getNodeName().equalsIgnoreCase(name)) {
                return no;
            }
        }
        return null;
    }
}