internal void MakeExistingAttributesOptional(XmlSchemaComplexType ct, XmlSchemaObjectCollection attributesInInstance) {
if (ct == null) {
throw new XmlSchemaInferenceException(Res.SchInf_noct, 0, 0);
}
if (ct.ContentModel != null) {
XmlSchemaSimpleContentExtension xssce = CheckSimpleContentExtension(ct);
SwitchUseToOptional(xssce.Attributes, attributesInInstance);
}
else { //either <xs:attribute> as child of xs:complexType or the attributes are within the content model
SwitchUseToOptional(ct.Attributes, attributesInInstance);
}
}