private bool CanRemoveAttribute(HtmlTag tag, HtmlAttribute attribute)
{
if (_settings.PreservableAttributeCollection.Count == 0)
{
return true;
}
string tagNameInLowercase = tag.NameInLowercase;
string attributeNameInLowercase = attribute.NameInLowercase;
string attributeValue = attribute.Value;
bool result = true;
foreach (HtmlAttributeExpression attributeExpression in _settings.PreservableAttributeCollection)
{
bool cannotRemove = attributeExpression.IsMatch(tagNameInLowercase, attributeNameInLowercase,
attributeValue);
if (cannotRemove)
{
result = false;
break;
}
}
return result;
}