Code example for Attr

Methods: getLocalName, getNamespaceURI, getOwnerElement, getPrefix, getValue

0
    /** {@inheritDoc} */ 
    protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
        AttributedString attributedString = (AttributedString) xmlObject;
         
        QName attribQName = 
            XMLHelper.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(), attribute.getPrefix());
        if (AttributedString.WSU_ID_ATTR_NAME.equals(attribQName)) {
            attributedString.setWSUId(attribute.getValue());
            attribute.getOwnerElement().setIdAttributeNode(attribute, true);
        } else { 
            XMLHelper.unmarshallToAttributeMap(attributedString.getUnknownAttributes(), attribute);
        } 
    } 
 
    /** {@inheritDoc} */ 
    protected void processElementContent(XMLObject xmlObject, String elementContent) {
        AttributedString attributedString = (AttributedString) xmlObject;
        attributedString.setValue(elementContent);
    } 
     
}