Link Search Menu Expand Document

XmlElement.RemoveAttributeNode Method

Explanation Delete the Attr node by specifying theXmlAttr.
Not supported in Mobile, AI
Call format elm.RemoveAttributeNode( attr )
Return value Deleted XmlAttr object.Returns null if it was not deleted .
Arguments XmlAttr attr XmlAttr object to delete
Exception DOM-7 NO_MODIFICATION_ALLOWED_ERR
DOM-8 NOT_FOUND_ERR
Example of use
    var domimpl = new XmlDOMImplementation;
    var res = session.Get("/test/sample.xml");
    var xmldoc = domimpl.Load(res);
    var elm = xmldoc.DocumentElement;
    var attr = elm.GetAttributeNode("width");
    elm.RemoveAttributeNode(attr);
    
Related item XmlAttr class
GetAttributeNode, SetAttributeNode, RemoveAttribute, RemoveAttributeNS methods