} else {
XMLSchemaSchema schema = _docDecl.grammar.getByNamespace(typeName[0]);
if(schema==null)
return onTypeResolutionFailure(sti,type,refErr);
final XMLSchemaTypeExp currentType = xe.parent.getTypeDefinition();
ComplexTypeExp cexp = schema.complexTypes.get(typeName[1]);
if(cexp!=null) {
if(cexp.isDerivedTypeOf( currentType,
xe.parent.block|currentType.getBlock() ))
// this type can substitute the current type.
contentModel = cexp;
else
return onNotSubstitutableType(sti,type,refErr);
} else {