Java XML Attribute Remove removeAttribute(final Node node, final String name)

Here you can find the source of removeAttribute(final Node node, final String name)

Description

remove Attribute

License

Apache License

Declaration

public static final void removeAttribute(final Node node, final String name) 

Method Source Code

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

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

public class Main {
    public static final void removeAttribute(final Node node, final String name) {
        if (node != null) {
            final NamedNodeMap namedNodeMap = node.getAttributes();
            if (namedNodeMap != null) {
                namedNodeMap.removeNamedItem(name);
            }//from   w w  w .j  a  v a 2  s  .  co  m
        }
    }
}

Related

  1. removeAllSubNodesExceptAttributes(Node n)
  2. removeAttribute(Element elem, String name)
  3. removeAttribute(Element element, String name)
  4. removeAttribute(final Attr attributeNode)
  5. removeAttribute(final Node iNode, final String iAttributeName)
  6. removeAttribute(Node iNode, String iAttributeName)
  7. removeAttribute(Node iNode, String iAttributeName)
  8. removeAttribute(Node node, String attName)
  9. removeAttribute(Node node, String attr)