Link Search Menu Expand Document

XmlDocument.CreateAttributeNS Method

Explanation Create an Attr node with a namespace URI.
Not supported in Mobile, AI
Call format var attr = xmldoc.CreateAttributeNS( namespaceURI, qualifiedName )
Return value XmlAttr object
Arguments String namespaceURI Namespace URI of the Attr node to be created
String qualifiedName Attribute name of the Attr node to be created
Exception DOM-5 INVALID_CHARACTER_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.CreateElement("rect");
    var attr = xmldoc.CreateAttributeNS("http://www.w3.org/2000/svg", "svg:x");
    attr.Value = "10";
    elm.SetAttributeNodeNS(attr);
    
Related item XmlAttr class
CreateAttribute method