Remove Attribute from XmlNode - CSharp System.Xml

CSharp examples for System.Xml:XML Attribute

Description

Remove Attribute from XmlNode

Demo Code

// This is free software licensed under the NUnit license. You may
using System.Xml;
using System.Collections.Generic;
using System;/*from   w w w .j a v  a 2 s.co m*/

public class Main{
        public static void RemoveAttribute(XmlNode node, string name)
        {
            XmlAttribute attr = node.Attributes[name];
            if (attr != null)
                node.Attributes.Remove(attr);
        }
}

Related Tutorials