Remove XML Attribute - CSharp System.Xml

CSharp examples for System.Xml:XML Attribute

Description

Remove XML Attribute

Demo Code

//              Copyright (c) 2006-2017 All Rights reserved                   *
using System.Xml.XPath;
using System.Xml;
using System.IO;//from  w w w  . j av  a2  s  .  c om
using System.Globalization;
using System;

public class Main{
        public static void RemoveAttribute(XmlElement element, string attributeName)
      {
         XmlAttribute attrDelete = null;
         attrDelete = (XmlAttribute)element.Attributes.GetNamedItem(attributeName);
         element.Attributes.Remove(attrDelete);
      }
}

Related Tutorials