internal void Prepare(XmlSchema schema, bool cleanup) {
if (schemasToCompile[schema] != null) {
return;
}
schemasToCompile.Add(schema, schema);
foreach (XmlSchemaElement element in schema.Elements.Values) {
if (cleanup) {
CleanupElement(element);
}
AddToTable(elements, element.QualifiedName, element);
}
foreach (XmlSchemaAttribute attribute in schema.Attributes.Values) {
if (cleanup) {
CleanupAttribute(attribute);
}
AddToTable(attributes, attribute.QualifiedName, attribute);
}
foreach (XmlSchemaGroup group in schema.Groups.Values) {
if (cleanup) {
CleanupGroup(group);
}
AddToTable(groups, group.QualifiedName, group);
}
foreach (XmlSchemaAttributeGroup attributeGroup in schema.AttributeGroups.Values) {
if (cleanup) {
CleanupAttributeGroup(attributeGroup);
}
AddToTable(attributeGroups, attributeGroup.QualifiedName, attributeGroup);
}
foreach (XmlSchemaType type in schema.SchemaTypes.Values) {
if (cleanup) {
XmlSchemaComplexType ct = type as XmlSchemaComplexType;
if (ct != null) {
CleanupComplexType(ct);
}
else {
CleanupSimpleType(type as XmlSchemaSimpleType);
}
}
AddToTable(schemaTypes, type.QualifiedName, type);
}
foreach (XmlSchemaNotation notation in schema.Notations.Values) {
AddToTable(notations, notation.QualifiedName, notation);
}
foreach (XmlSchemaIdentityConstraint ic in schema.IdentityConstraints.Values) {
AddToTable(identityConstraints, ic.QualifiedName, ic);
}
}