Check that the attribute is valid.