Java XML Attribute Remove removeAttribute(Node node, String attName)

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

Description

remove Attribute

License

Apache License

Declaration

public static void removeAttribute(Node node, String attName) 

Method Source Code

//package com.java2s;
/*//from  w  ww .  j  a v a  2  s . co m
 * Copyright 1999,2004 The Apache Software Foundation.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

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

public class Main {
    public static void removeAttribute(Node node, String attName) {
        NamedNodeMap attributes = node.getAttributes();
        attributes.removeNamedItem(attName);
    }
}

Related

  1. removeAttribute(final Attr attributeNode)
  2. removeAttribute(final Node iNode, final String iAttributeName)
  3. removeAttribute(final Node node, final String name)
  4. removeAttribute(Node iNode, String iAttributeName)
  5. removeAttribute(Node iNode, String iAttributeName)
  6. removeAttribute(Node node, String attr)
  7. removeAttribute(Node node, String attrName)
  8. removeAttribute(Node node, String... attributs)
  9. removeAttribute(Node parent, String name, String value, boolean recursive)