CSharp examples for System.Xml:XML Attribute
Add the specified XML attribute.
// Licensed under the Apache License, Version 2.0 (the "License"); using System.Xml; using System.Text; using System.Linq; using System.Collections.Generic; using System;//from ww w . j a va 2s. c o m public class Main{ /// <summary> /// Add the specified attribute. /// </summary> /// <param name="e">The node to add the attribute to.</param> /// <param name="name">The name of the attribute.</param> /// <param name="value_ren">The value of the attribute.</param> public static void AddAttribute(XmlNode e, String name, String value_ren) { XmlAttribute attr = e.OwnerDocument.CreateAttribute(name); attr.Value = value; e.Attributes.SetNamedItem(attr); } }