Java XML Node Remove removeAll(Node node)

Here you can find the source of removeAll(Node node)

Description

remove All

License

Open Source License

Declaration

public static void removeAll(Node node) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import org.w3c.dom.Node;

public class Main {
    public static void removeAll(Node node) {
        while (node.getChildNodes().getLength() > 0) {
            node.removeChild(node.getFirstChild());
        }/*  w  w w  .  jav a 2  s .  co m*/
    }
}

Related

  1. removeAll(final Node node, final short nodeType, final String name)
  2. removeAll(Node node, short nodeType, String name)
  3. removeAll(Node node, short nodeType, String name)
  4. removeContents(Node parent)
  5. removeElement(Element parent, String tagName)