Link Search Menu Expand Document

XmlElement.SetAttributeNS Method

Explanation Set the value of the Attr node by specifying the namespace URI and attribute name.
Not supported in Mobile, AI
Call format elm.SetAttributeNS( namespaceURI, name, value )
Return value
Arguments String namespaceURI Namespace URI of the Attr node for which value you want to set
String name Attribute name of the Attr node for which value you want to set
String value Value to set
Exception DOM-5 INVALID_CHARACTER_ERR
DOM-7 NO_MODIFICATION_ALLOWED_ERR
DOM-14 NAMESPACE_ERR
Example of use
    var domimpl = new XmlDOMImplementation;
    var res = session.Get("/test/sample.xml");
    var xmldoc = domimpl.Load(res);
    var elm = xmldoc.DocumentElement;
    elm.SetAttributeNS("http://www.w3.org/2000/svg ", "width", "100");
    
Related item XmlAttr class
GetAttributeNS, RemoveAttributeNS, HasAttributeNS, SetAttribute, SetAttributeNode, SetAttributeNodeNS method