FormatElement format = (FormatElement)simpleTypeMap.get(typename);
if (format == null) {
// check for restriction with simple base, and treat as base if so
XmlSchemaSimpleType stype = (XmlSchemaSimpleType)element.getSchemaType();
XmlSchemaSimpleTypeContent content = stype.getContent();
if (content instanceof XmlSchemaSimpleTypeRestriction) {
QName tname = ((XmlSchemaSimpleTypeRestriction)content).getBaseTypeName();
if (SCHEMA_NAMESPACE.equals(tname.getNamespaceURI())) {
format = (FormatElement)simpleTypeMap.get(tname);
if (format != null) {