for (XSDAttributeDeclaration attribute : (List<XSDAttributeDeclaration>) Schemas
.getAttributeDeclarations(xsdType, false)) {
if (attribute.isAttributeDeclarationReference()) {
attribute = attribute.getResolvedAttributeDeclaration();
}
XSDSimpleTypeDefinition type = attribute.getTypeDefinition();
if (type == null) {
// look up in global schema
for (XSDAttributeDeclaration ad : schema.getAttributeDeclarations()) {
if (Utilities.equals(ad.getTargetNamespace(),
attribute.getTargetNamespace())
&& Utilities.equals(ad.getName(), attribute.getName())) {
type = ad.getTypeDefinition();
break;
}
}
}
if (type == null) {
throw new RuntimeException(
"Could not locate type definition for attribute "
+ name(attribute) + " of " + getName());
}
if (type.getName() == null) {
// TODO: deal with anonymous attribute types
continue;
}
AttributeType gtType = createType(type, DUMMY_DEPTH);
// TODO: if attribute is required