public static SetAttributeValue ( this xmlElement, string attributeName, string value ) : void | ||
xmlElement | this | The node |
attributeName | string | Name of the attribute |
value | string | Value to set the attribute to |
return | void |
public static void SetAttributeValue(this XmlElement xmlElement, string attributeName, string value)
{
XmlAttribute attr = xmlElement.Attributes[attributeName];
if (attr == null)
{
AddAttribute(xmlElement, attributeName, value);
}
else
{
attr.Value = value;
}
}