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 {
    /***
     * Remove all children nodes
     * 
     * @param node
     *            node to remove children from
     * 
     */
    public static void removeAllChilden(final Node node) {
        if (node != null) {
            final NodeList childrens = node.getChildNodes();

            for (int i = 0; i < childrens.getLength(); i++) {
                node.removeChild(childrens.item(i));
            }
        }
    }
}