CSharp examples for System.Xml:XML Attribute
Add XML Attribute
using System.Xml; public class Main{ public static void AddAttribute(XmlNode parent, string name, string value) {//from www . j av a 2 s.c o m if (parent == null || string.IsNullOrEmpty(name)) return; XmlAttribute attribute = parent.OwnerDocument.CreateAttribute(name); attribute.Value = value; parent.Attributes.Append(attribute); } }