Example usage for org.w3c.dom Attr toString

List of usage examples for org.w3c.dom Attr toString

Introduction

In this page you can find the example usage for org.w3c.dom Attr toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:org.apache.axis2.jaxws.message.util.impl.XMLStreamReaderFromDOM.java

/** @return list of attributes that are not namespace declarations */
private List getAttributes() {
    if (event == XMLStreamReader.START_ELEMENT) {
        List attrs = new ArrayList();
        NamedNodeMap map = ((Element) cursor).getAttributes();
        if (map != null) {
            for (int i = 0; i < map.getLength(); i++) {
                Attr attr = (Attr) map.item(i);
                if (attr.getName().equals("xmlns") || attr.getName().startsWith("xmlns:")) {
                    // this is a namespace declaration
                } else {
                    if (log.isDebugEnabled()) {
                        log.debug("Attr string: " + attr.toString());
                    }//w w w .jav  a2s  . c om
                    attrs.add(attr);
                }
            }
        }
        return attrs;
    }
    throw new IllegalStateException(Messages.getMessage("XMLSRErr4", "getAttributes()"));
}