Java XML Attribute Remove removeAttributes(SOAPElement elem)

Here you can find the source of removeAttributes(SOAPElement elem)

Description

remove Attributes

License

Open Source License

Declaration

public static void removeAttributes(SOAPElement elem) 

Method Source Code


//package com.java2s;
/*// w  w w. j  a v  a  2 s  .c om
 * JBoss, Home of Professional Open Source
 * Copyright 2005, JBoss Inc., and individual contributors as indicated
 * by the @authors tag.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the JBPM BPEL PUBLIC LICENSE AGREEMENT as
 * published by JBoss Inc.; either version 1.0 of the License, or
 * (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 */

import java.util.Iterator;

import javax.xml.soap.Name;

import javax.xml.soap.SOAPElement;

public class Main {
    public static void removeAttributes(SOAPElement elem) {
        if (elem.hasAttributes()) {
            Iterator attrNameIt = elem.getAllAttributes();
            while (attrNameIt.hasNext()) {
                Name attrName = (Name) attrNameIt.next();
                elem.removeAttribute(attrName);
            }
        }
    }
}

Related

  1. removeAttributeIgnoreCase(Element element, String attributeName)
  2. removeAttributes(Element e, String namespaceURI)
  3. removeAttributes(Element elem)
  4. removeAttributes(Element element)
  5. removeAttributes(Element target, boolean flag)
  6. removeDefaultNameSpaceAttributes(final Element element)
  7. removeEmptyAttributes(Element element)
  8. removeInvalidAttributes(Element element, String... validAttributeNames)
  9. removeNodeAttribute(Node node, String attributeName)