private void onDatatypeElement(Element xsdElement,DocumentFactory parentFactory){
  String name=xsdElement.attributeValue("name");
  String type=xsdElement.attributeValue("type");
  QName qname=getQName(name);
  DatatypeElementFactory factory=getDatatypeElementFactory(qname);
  if (type != null) {
    XSDatatype dataType=getTypeByName(type);
    if (dataType != null) {
      factory.setChildElementXSDatatype(qname,dataType);
    }
 else {
      QName typeQName=getQName(type);
      namedTypeResolver.registerTypedElement(xsdElement,typeQName,parentFactory);
    }
    return;
  }
  Element xsdSimpleType=xsdElement.element(XSD_SIMPLETYPE);
  if (xsdSimpleType != null) {
    XSDatatype dataType=loadXSDatatypeFromSimpleType(xsdSimpleType);
    if (dataType != null) {
      factory.setChildElementXSDatatype(qname,dataType);
    }
  }
  Element schemaComplexType=xsdElement.element(XSD_COMPLEXTYPE);
  if (schemaComplexType != null) {
    onSchemaComplexType(schemaComplexType,factory);
  }
  Iterator<Element> iter=xsdElement.elementIterator(XSD_ATTRIBUTE);
  if (iter.hasNext()) {
    do {
      onDatatypeAttribute(xsdElement,factory,iter.next());
    }
 while (iter.hasNext());
  }
}

private void onDatatypeElement ( Element xsdElement , DocumentFactory parentFactory ) { String name = xsdElement . attributeValue ( "name" ) ; String type = xsdElement . attributeValue ( "type" ) ; QName qname = getQName ( name ) ; DatatypeElementFactory factory = getDatatypeElementFactory ( qname ) ; if ( type != null ) { XSDatatype dataType = getTypeByName ( type ) ; if ( dataType != null ) { factory . setChildElementXSDatatype ( qname , dataType ) ; } else { QName typeQName = getQName ( type ) ; namedTypeResolver . registerTypedElement ( xsdElement , typeQName , parentFactory ) ; } return ; } Element xsdSimpleType = xsdElement . element ( XSD_SIMPLETYPE ) ; if ( xsdSimpleType != null ) { XSDatatype dataType = loadXSDatatypeFromSimpleType ( xsdSimpleType ) ; if ( dataType != null ) { factory . setChildElementXSDatatype ( qname , dataType ) ; } } Element schemaComplexType = xsdElement . element ( XSD_COMPLEXTYPE ) ; if ( schemaComplexType != null ) { onSchemaComplexType ( schemaComplexType , factory ) ; } Iterator < Element > iter = xsdElement . elementIterator ( XSD_ATTRIBUTE ) ; if ( iter . hasNext ( ) ) { do { onDatatypeAttribute ( xsdElement , factory , iter . next ( ) ) ; } while ( iter . hasNext ( ) ) ; } }
processes an xml schema & lt ; element & gt ; tag
