List of utility methods to do XML Node Remove
void | removeNode(Node node) Removes a node from its tree. node.getParentNode().removeChild(node); |
void | removeNode(Node node) remove Node if (node != null) { Node parent = node.getParentNode(); if (parent != null) { parent.removeChild(node); |
void | removeNode(Node node) remove Node node.getParentNode().removeChild(node); |
void | removeNodeFromParent(Node node) remove Node From Parent Node parent = node.getParentNode(); parent.removeChild(node); |
void | removeNodes(Element parent, NodeList elements) remove Nodes List<Node> nodesToRemove = new ArrayList<Node>(); for (int i = 0; i < elements.getLength(); i++) { Node item = elements.item(i); if (item.getParentNode() == parent) { nodesToRemove.add(item); for (Node n : nodesToRemove) { ... |
void | removeNodesByName(Node node, String name) remove Nodes By Name NodeList nl = node.getChildNodes(); int i = 0; while (i < nl.getLength()) if (nl.item(i).getNodeName().equals(name)) node.removeChild(nl.item(i)); else i++; |
void | removePreviousWhiteSpace(Node node) remove Previous White Space Node prev = node.getPreviousSibling();
if (prev != null && prev.getNodeType() == Node.TEXT_NODE && prev.getNodeValue().trim().length() == 0) {
node.getParentNode().removeChild(prev);
|
Node | removeQueryCallBody(Node queryElement) remove Query Call Body if ("QueryRequest".equals(queryElement.getNodeName())) { return queryElement.getFirstChild().getFirstChild(); return null; |
Node | removeSelf(Node node) delete a Node which was appointed in an argument. if (node == null) return null; Node pNode = node.getParentNode(); if (pNode != null) { return pNode.removeChild(node); return null; |
Node | removeTextNodes(Node parent) Removes all the immediate child text nodes. Node result = parent; NodeList nodeList = parent.getChildNodes(); int nodeListSize = nodeList.getLength(); for (int i = 0; i < nodeListSize; i++) { Node child = nodeList.item(i); if (child != null && child.getNodeType() == Node.TEXT_NODE) { parent.removeChild(child); return result; |