public object GetValueOrDefault(XmlElement element)
{
object obj;
try
{
obj = Parse(element);
}
catch (Exception)
{
// If anything goes wrong just return the default value.
return Default;
}
if (Validator != null && !Validator(obj))
{
if (Coercer != null)
{
return Coercer(obj);
}
return Default;
}
return obj;
}