Link Search Menu Expand Document

XmlElement.SetAttributeNodeNS Method

Explanation Specify the XmlAttrobject to configure the Attr node.
If there is an Attr node with the same namespace URI and attribute name as the specified XmlAttr object, it will replace the Attr node.
Not supported in Mobile, AI
Call format var attr2 = elm.SetAttributeNodeNS( attr )
Return value Replaced XmlAttr object
Returns null if there was no replacement.
Arguments XmlAttr attr XmlAttr object to be set
An Attr node that has already been set to another Element node cannot be specified.
Exception DOM-4 WRONG_DOCUMENT_ERR
DOM-7 NO_MODIFICATION_ALLOWED_ERR
DOM-10 INUSE_ATTRIBUTE_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.GetAttributeNodeNS("http://www.w3.org/2000/svg", "width");
    var attr2 = attr.CloneNode($TRUE);
    elm.SetAttributeNodeNS(attr2);
    
Related item XmlAttr class
GetAttributeNodeNS, SetAttribute, SetAttributeNode, SetAttributeNS method