List of utility methods to do XML Child Remove
void | removeChild(Element parent, String name) remove Child NodeList children = parent.getChildNodes(); if (children == null) return; for (int i = 0; i < children.getLength(); i++) { Node child = children.item(i); if (child.getNodeName().equalsIgnoreCase(name)) { parent.removeChild(child); |
void | removeChild(final Node node, final Node child) remove Child if (node != null) {
node.removeChild(child);
|
Node | removeChild(Node xmlNode, String name, boolean ignoreCase) remove Child Node removedChild = null; String key = name; if (ignoreCase) key = key.toLowerCase(); NodeList childNodes = xmlNode.getChildNodes(); for (int i = 0; i < childNodes.getLength(); i++) { Node child = childNodes.item(i); String childName = child.getNodeName(); ... |
void | removeChild(NodeList nodes) remove Child for (int i = 0; i < nodes.getLength(); i++) { nodes.item(i).getParentNode().removeChild(nodes.item(i)); |
void | removeChildElements(Element parent) removes all children of element type List v = getChildElements(parent);
Iterator en = v.iterator();
while (en.hasNext())
parent.removeChild((Node) en.next());
|
void | removeChildNodes(Node node) remove Child Nodes for (Node current = node.getFirstChild(), next; current != null; current = next) {
next = current.getNextSibling();
node.removeChild(current);
|
void | removeChildNodes(Node node) remove Child Nodes NodeList nl = node.getChildNodes();
while (nl.getLength() > 0)
node.removeChild(nl.item(0));
|
void | removeChildNodes(Node node, short... ignoreNodeTypes) remove Child Nodes HashSet<Node> childNodesSet = getValidChildNodes(node, false, ignoreNodeTypes);
for (Node childNode : childNodesSet) {
node.removeChild(childNode);
|
void | removeChildNodes(Node parent) remove Child Nodes while (parent.hasChildNodes()) {
parent.removeChild(parent.getFirstChild());
|
void | removeChildren(Element el) Remove all childs element from el while (el.getChildNodes().getLength() > 0) {
el.removeChild(el.getChildNodes().item(0));
|