DatatypeElementFactory factory = getDatatypeElementFactory(qname);
if (type != null) {
// register type with this element name
XSDatatype dataType = getTypeByName(type);
if (dataType != null) {
factory.setChildElementXSDatatype(qname, dataType);
} else {
QName typeQName = getQName(type);
namedTypeResolver.registerTypedElement(xsdElement, typeQName,
parentFactory);
}
return;
}
// handle element types derrived from simpleTypes
Element xsdSimpleType = xsdElement.element(XSD_SIMPLETYPE);
if (xsdSimpleType != null) {
XSDatatype dataType = loadXSDatatypeFromSimpleType(xsdSimpleType);
if (dataType != null) {
factory.setChildElementXSDatatype(qname, dataType);
}
}