Java XML Child Remove removeChildren(Node parent)

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

Description

remove Children

License

Apache License

Declaration

public static void removeChildren(Node parent) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import org.w3c.dom.Node;

public class Main {
    public static void removeChildren(Node parent) {
        for (;;) {
            Node n = parent.getFirstChild();

            if (n == null) {
                break;
            }//from  ww w .  j ava2  s  .  co m

            parent.removeChild(n);
        }
    }
}

Related

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