public RemoveAttribute ( string xPath, string name ) : void | ||
xPath | string | xPath表达式 |
name | string | 要移除的属性名 |
return | void |
public void RemoveAttribute(string xPath,string name)
{
var element = GetXElement(xPath);
if (element == null) return;
var attribute = element.Attribute(name);
if (attribute == null) return;
attribute.Remove();
}