List of utility methods to do XML Element Remove
void | removeWhitespaces(Element element) remove Whitespaces NodeList children = element.getChildNodes(); for (int i = 0; i < children.getLength();) { Node n = children.item(i); if (n instanceof Element) { removeWhitespaces((Element) n); ++i; } else if (n instanceof Text && ((Text) n).getTextContent().trim().length() == 0) { element.removeChild(n); ... |
void | removeXmlBase(Element e) remove Xml Base e.removeAttributeNS("http://www.w3.org/XML/1998/namespace", "base"); e.removeAttribute("xml:base"); |