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.Document;

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

public class Main {
    public static Node getRootNode(Document doc) {
        NodeList l = doc.getChildNodes();
        if (l != null && l.getLength() == 1)
            return l.item(0);

        return null;
    }
}