+ protected QName getPrimitiveType(Attribute attribute) {\r
+ QName type = getBaseType(attribute);\r
+ String b = getBindingFromPrimitiveType(type);\r
+ while (b==null && type != null) {\r
+ SchemaObject baseType = simpleTypeName.get(type.getLocalPart());\r
+ if (baseType != null) {\r
+ Restriction restriction = baseType.getSimpleType().getRestriction();\r
+ if (restriction != null)\r
+ if (restriction.getBase() != null) {\r
+ type = restriction.getBase();\r
+ b = getBindingFromPrimitiveType(type);\r
+ }\r
+ }\r
+ }\r
+ return type;\r
+ }\r
+ \r