}
} else if (derivation.type() == SchemaBase.UNION_TYPE) {
UnionElement innerunion = (UnionElement)derivation;
QName[] innertypes = innerunion.getMemberTypes();
FilteredSegmentList innerinlines = innerunion.getInlineBaseList();
if (innertypes.length + innerinlines.size() == 1) {
// replace child union with single type from union
if (innertypes.length == 1) {
// global type reference, delete the child union and check if new type
repltype = innertypes[0];
if (typeset.contains(repltype)) {
keeper = false;
}
} else {
// inline type definition, replace the child union with the inline type
union.replaceChild(i, (SchemaBase)innerinlines.get(0));
}
}
}
}