if (type instanceof XmlSchemaComplexType) {
XmlSchemaComplexType complexType = (XmlSchemaComplexType) type;
if (complexType.getContentModel() != null) {
XmlSchemaContentModel content = complexType.getContentModel();
if (content instanceof XmlSchemaComplexContent) {
XmlSchemaComplexContent complexContent =
(XmlSchemaComplexContent) content;
if (complexContent.getContent() instanceof
XmlSchemaComplexContentExtension) {
XmlSchemaComplexContentExtension extension =
(XmlSchemaComplexContentExtension) complexContent.getContent();
//recursively call the copyMetaInfoHierarchy method
copyMetaInfoHierarchy(baseMetaInfoHolder,
extension.getBaseTypeName(),
resolvedSchema);
} else if (complexContent.getContent() instanceof
XmlSchemaComplexContentRestriction) {
XmlSchemaComplexContentRestriction restriction =
(XmlSchemaComplexContentRestriction) complexContent.getContent();
//recursively call the copyMetaInfoHierarchy method
copyMetaInfoHierarchy(baseMetaInfoHolder,
restriction.getBaseTypeName(),
resolvedSchema);