private bool VerifyChoicesAndMappingsSchema(XmlElement rawResponseOfGetList, string expectedFieldName)
{
// Extract the Choices and Mapping xml string from response of GetList operation.
List<string> choicesAndMappingXmlstrings = this.GetChoicesAndMappingsXmlString(rawResponseOfGetList, expectedFieldName);
// Verify the schema definition of Choices and Mapping elements.
foreach (string elementXmlString in choicesAndMappingXmlstrings)
{
SchemaValidation.ValidateXml(this.Site, elementXmlString);
if (SchemaValidation.ValidationResult != ValidationResult.Success)
{
string validationErrorMessage = SchemaValidation.GenerateValidationResult();
throw new XmlSchemaValidationException(validationErrorMessage);
}
}
// If there are no any schema validation exception thrown, return true.
return true;
}