public static bool Validate( string nameSpace, string elementName, object testSubject,
SchemaValidationResult schemaValidationResult)
{
bool isValid = true;
XmlSchemaComplexType complexType;
XmlSchemaElement element;
if (GetComplexType( nameSpace, elementName, out complexType ))
{
isValid &= ValidateComplexType( complexType, testSubject, schemaValidationResult );
}
else
{
if (Instance._schemaTypes.ContainsKey( nameSpace + ":" + elementName ))
{
int i = 0;
}
if (GetElement( nameSpace, elementName, out element ))
{
isValid &= ValidateElement( element, testSubject, schemaValidationResult );
}
}
return !schemaValidationResult.HasErrors();
}