Set XML Attribute - CSharp System.Xml

CSharp examples for System.Xml:XML Attribute

Description

Set XML Attribute

Demo Code


using System.Xml;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;// ww  w . j  a v  a 2s  .  c  om

public class Main{
        public static void SetAttr(this XmlElement element, string propName, int propValue)
        {
            element.SetAttribute(propName, propValue.ToString());
        }
        public static void SetAttr(this XmlElement element, string propName, string propValue)
        {
            element.SetAttribute(propName, propValue);
        }
}

Related Tutorials