Hi, I tried with AppendChild in this way:
dim objDoc
set objDoc = CreateObject("Msxml2.DOMDocument.5.0")
objDoc.setProperty "SelectionNamespaces", "xmlns:dfs=""http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"" " & "xmlns:my=""http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-06-29T14:42:29"" "
stringXML="<my:Plant> .... </my:Plant>"
objDoc.loadXML(stringXML)
objDoc.async = false
dim oParentNode
set oParentNode = XDocument.DOM.selectSingleNode("//my:Sezione1")
dim Node
set Node = objDoc.selectSingleNode("//my:Plant")
oParentNode.appendChild(Node)but Infopath can't load stringXML becouse of "Reference to an undeclered namespace 'my'"; so I tried to change stringXML:
stringXML="<my:Plant xmlns:my=""http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-06-29T14:42:29> .... </my:Plant>"
But this time there's another error:
"Element '
http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-06-29T14:42:29}Plant' is unexpected according to content model of parent element '
http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-06-29T14:42:29}Sezione1'."How can I make this code work!? :)))
Thank you all!