Java XML Child Remove removeChildren(Node parent)

Here you can find the source of removeChildren(Node parent)

Description

remove Children

License

Open Source License

Declaration

public static void removeChildren(Node parent) 

Method Source Code

//package com.java2s;

import org.w3c.dom.Node;

public class Main {
    public static void removeChildren(Node parent) {
        Node child = parent.getFirstChild();
        while (child != null) {
            Node next = child.getNextSibling();

            parent.removeChild(child);/*w  ww .ja  v  a  2  s .  c o m*/

            child = next;
        }
    }
}

Related

  1. removeChildren(Node node)
  2. removeChildren(Node node)
  3. removeChildren(Node node)
  4. removeChildren(Node node, String name)
  5. removeChildren(Node parent)
  6. removeChildren(Node parent, NodeList nodelist)
  7. removeChildren(Node target)
  8. removeChildren(Node xmlNode, String name, boolean ignoreCase)
  9. removeChildrenNode(Node node)