Example usage for org.w3c.dom Attr getSchemaTypeInfo

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

Introduction

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

Prototype

public TypeInfo getSchemaTypeInfo();

Source Link

Document

The type information associated with this attribute.

Usage

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

public String getAttributeType(int index) {
    String attrType = null;//from w w  w  . jav  a  2s  .c o  m
    Attr attr = (Attr) getAttributes().get(index);
    TypeInfo typeInfo = attr.getSchemaTypeInfo();
    if (typeInfo != null) {
        attrType = typeInfo.getTypeName();
    }

    if (attrType == null) {
        try {
            attrType = (String) attr.getUserData(SAAJConverter.OM_ATTRIBUTE_KEY);
            if (log.isDebugEnabled()) {
                log.debug("Retrieving attrType from UserData: " + attrType);
            }
        } catch (Exception e) {
            if (log.isDebugEnabled()) {
                log.debug("An error occured while getting attrType: " + e.getMessage());
            }
        }
    }

    return attrType;
}