String name = startTag.getAttribute("name");
if( name==null ) {
if( isGlobal() )
reader.reportError( XMLSchemaReader.ERR_MISSING_ATTRIBUTE, "complexType", "name" );
decl = new ComplexTypeExp( reader.currentSchema, null );
} else {
if( isRedefine() )
// in redefine mode, use temporary object.
// parsed complexType will be copied into the original one.
decl = new ComplexTypeExp( reader.currentSchema, name );
else {
decl = reader.currentSchema.complexTypes.getOrCreate(name);
// MSV has pre-defiend types in xsd namespace (such as xs:anyType)
// this causes a problem when we are parsing schema4schema.
// to avoid this problem, we won't issue this error when we are