return binding;
}
private AttributeBinding bindAttribute(XSAttributeUse attrUse)
{
XSAttributeDeclaration attr = attrUse.getAttrDeclaration();
QName attrName = new QName(attr.getNamespace(), attr.getName());
XSSimpleTypeDefinition attrType = attr.getTypeDefinition();
TypeBinding typeBinding = bindSimpleType(attrType);
if (trace)
{
log.trace("binding attribute " + attrName + ", required=" + attrUse.getRequired());
}
AttributeBinding binding = new AttributeBinding(schema, attrName, typeBinding, DefaultHandlers.ATTRIBUTE_HANDLER);
binding.setRequired(attrUse.getRequired());
if(attrUse.getConstraintType() == XSConstants.VC_DEFAULT)
{
// Associate the default value with the binding
binding.setDefaultConstraint(attrUse.getConstraintValue());
}
if (processAnnotations)
{
XSAnnotation an = attr.getAnnotation();
if(an != null)
{
if (trace)
{
log.trace(attrName + " attribute annotation");