Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
// Licensed to the Apache Software Foundation (ASF) under one

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

public class Main {
    public static Node getChildNode(Node parentNode, String childElementName) {
        NodeList l = parentNode.getChildNodes();
        for (int i = 0; i < l.getLength(); i++) {
            Node node = l.item(i);
            if (node.getNodeName().equals(childElementName))
                return node;
        }
        return null;
    }
}