schema.resolveElementDeclaration(gmlNamespace, substitutionGroup));
//find the type of the element
List<XSDComplexTypeDefinition> candidates = new ArrayList<XSDComplexTypeDefinition>();
for ( Iterator t = ftSchema.getTypeDefinitions().iterator(); t.hasNext(); ) {
XSDTypeDefinition type = (XSDTypeDefinition) t.next();
if ( type instanceof XSDComplexTypeDefinition ) {
XSDTypeDefinition base = type.getBaseType();
while(base != null ) {
if ( baseType.equals(base.getName())
&& gmlNamespace.equals( base.getTargetNamespace() ) ) {
candidates.add( (XSDComplexTypeDefinition) type );
break;
}
if ( base.equals( base.getBaseType() ) ) {
break;
}
base = base.getBaseType();
}
}
}
if ( candidates.size() != 1 ) {