private XmlSchemaParticle CannonicalizeElement(XmlSchemaElement element, bool substitution) {
if (!element.RefName.IsEmpty && substitution && (element.BlockResolved & XmlSchemaDerivationMethod.Substitution) == 0) {
XmlSchemaSubstitutionGroupV1Compat substitutionGroup = (XmlSchemaSubstitutionGroupV1Compat)examplars[element.QualifiedName];
if (substitutionGroup == null) {
return element;
}
else {
XmlSchemaChoice choice = (XmlSchemaChoice)substitutionGroup.Choice.Clone();
choice.MinOccurs = element.MinOccurs;
choice.MaxOccurs = element.MaxOccurs;
return choice;
}
}
else {
return element;
}
}