Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
// License as published by the Free Software Foundation; either

import org.w3c.dom.Node;

public class Main {
    public static Node getFirstChildElement(Node node) {
        for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
            if (child.getNodeType() != Node.TEXT_NODE) {
                return child;
            }
        }

        return null;
    }
}