// <attribute name="foo" type="xs:int"/>
// </>
//
// or it could also be an in-lined type (attr ref)
//
LocalAttribute localAttribute = attr.attribute();
final String attrURI = ap.getXmlName().getNamespaceURI();
if (attrURI.equals("") /*|| attrURI.equals(uri) --- those are generated as global attributes anyway, so use them.*/) {
localAttribute.name(ap.getXmlName().getLocalPart());
writeAttributeTypeRef(ap, localAttribute);
attributeFormDefault.writeForm(localAttribute,ap.getXmlName());
} else { // generate an attr ref
localAttribute.ref(ap.getXmlName());
}
if(ap.isRequired()) {
// TODO: not type safe
localAttribute.use("required");
}
}