Java XML Attribute Remove removeAttribute(Node node, String... attributs)

Here you can find the source of removeAttribute(Node node, String... attributs)

Description

remove Attribute

License

BSD License

Declaration

public static boolean removeAttribute(Node node, String... attributs) 

Method Source Code

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

import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;

public class Main {
    public static boolean removeAttribute(Node node, String... attributs) {
        NamedNodeMap att = node.getAttributes();
        if (att == null)
            return false;
        boolean ret = false;
        for (String attribut : attributs) {
            if (att.getNamedItem(attribut) != null) {
                att.removeNamedItem(attribut);
                ret = true;//from   ww w .  jav  a  2 s  .com
            }
        }
        return ret;
    }
}

Related

  1. removeAttribute(Node iNode, String iAttributeName)
  2. removeAttribute(Node iNode, String iAttributeName)
  3. removeAttribute(Node node, String attName)
  4. removeAttribute(Node node, String attr)
  5. removeAttribute(Node node, String attrName)
  6. removeAttribute(Node parent, String name, String value, boolean recursive)
  7. removeAttributeIgnoreCase(Element element, String attributeName)
  8. removeAttributes(Element e, String namespaceURI)
  9. removeAttributes(Element elem)