Does anyone know of any snippets of code to add an attribute to an element using the MSXML 2.6? My production environment is standardized on it and MSDN now only supports MSXML 3.0 (msxml2.dll)
Thanks in advance for any help you can offer.
-Simon
Printable View
Does anyone know of any snippets of code to add an attribute to an element using the MSXML 2.6? My production environment is standardized on it and MSDN now only supports MSXML 3.0 (msxml2.dll)
Thanks in advance for any help you can offer.
-Simon
Can you not just use setNamedItem? i.e.
Code:Dim d As MSXML2.DOMDocument
Dim e As MSXML2.IXMLDOMElement
Dim a As MSXML2.IXMLDOMAttribute
Set d = New MSXML2.DOMDocument
Set e = d.createElement("E1")
Set a = d.createAttribute("A1")
a.nodeValue = "v1"
e.Attributes.setNamedItem a
td.