Java XML Attribute Copy copyAttributes(SOAPElement target, Element source)

Here you can find the source of copyAttributes(SOAPElement target, Element source)

Description

copy Attributes

License

Open Source License

Declaration

public static void copyAttributes(SOAPElement target, Element source) 

Method Source Code


//package com.java2s;
import org.w3c.dom.*;

import javax.xml.soap.SOAPElement;

public class Main {
    public static void copyAttributes(SOAPElement target, Element source) {
        NamedNodeMap attrs = source.getAttributes();
        for (int i = 0; i < attrs.getLength(); i++) {
            Node nd = attrs.item(i);
            target.setAttribute(nd.getNodeName(), nd.getNodeValue());
        }//  w  w  w.ja  v a 2  s .c om
    }
}

Related

  1. copyAttributes(Element from, Element to, NodeFilter filter)
  2. copyAttributes(Element fromEl, Element toEl)
  3. copyAttributes(final Element destElement, final Element srcElement)
  4. copyAttributes(Node from, Node to)
  5. copyAttributes(Node sourceNode, Element visualElement)