Can some give me some advice on how i can add an XML Complex type array to an xml element?
I have successfully created an IXMLNodeList. I then try to create an array of IXMLNodeList and tried to assign the array to an IXMLNode element, but i get a type mismatch.
[code] Set xmlRoot = xmlDoc.createElement("RemoteIssue")
Set xmlElement = xmlDoc.createElement("type")
xmlElement.Text = 14
xmlRoot.appendChild xmlElement
Set xmlElement = xmlDoc.createElement("project")
xmlElement.Text = RONID
xmlRoot.appendChild xmlElement
Set xmlElement = xmlDoc.createElement("summary")
xmlElement.Text = subject
xmlRoot.appendChild xmlElement
Set xmlElement = xmlDoc.createElement("reporter")
xmlElement.Text = USERNAME
xmlRoot.appendChild xmlElement
Set xmlElement = xmlDoc.createElement("description")
xmlElement.Text = body
xmlRoot.appendChild xmlElement
If RONID = "2RON" Then
Set xmlElement = xmlDoc.createElement("customfieldvalues")
Dim xmlCustomFields(0 To 1) As MSXML2.IXMLDOMNodeList
Dim xmlCustomRoot As MSXML2.IXMLDOMElement
Dim xmlCustomElement As MSXML2.IXMLDOMElement
Set xmlCustomRoot = xmlDoc.createElement("RemoteCustomFieldValue")
Set xmlCustomElement = xmlDoc.createElement("customfield_10001")
xmlCustomElement.Text = "Email"
xmlCustomRoot.appendChild xmlCustomElement
Set xmlCustomFields(0) = xmlCustomRoot.childNodes
Set xmlCustomRoot = xmlDoc.createElement("RemoteCustomFieldValue")
Set xmlCustomElement = xmlDoc.createElement("customfield_10040")
xmlCustomElement.Text = "London"
xmlCustomRoot.appendChild xmlCustomElement
Set xmlCustomFields(1) = xmlCustomRoot.childNodes
xmlElement.Text = xmlCustomFields
End If
xmlDoc.appendChild xmlRoot[/code]