Link Search Menu Expand Document

XmlNamedNodeMap.SetNamedItemNS Method

Explanation Specify the XmlNode object to set the node.
If a node with the same namespace URI and name as the specified node is already included in the node map, that node will be replaced.
Call format var node = map.SetNamedItemNS( newNode )
Return value Replaced XmlNode object
Returns null if the replacement did not occur .
Arguments XmlNode newNode Node to be set
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 map = xmldoc.DocumentElement.Attributes;
    var attr = dom.CreateAttributeNS("http://www.w3.org/2000/svg", "width");
    attr.Value = "10";
    map.SetNamedItemNS(attr);
    
Related item XmlNode class
GetNamedItemNS, RemoveNamedItemNS, SetNamedItem method