Ok I have understand what is getParentNode()
it's a selectsinglenode of the reapeating section!
But now I have an error in the last line:
oParentNode.appendChild(domXMLNode.documentElement);
that make me the following error:
quote:
System.Runtime.InteropServices.COMException
Element 'Person' is unexpected according to content model of parent element 'Person'.
at Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode.appendChild(IXMLDOMNode newChild)
at Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeWrapper.appendChild(IXMLDOMNode newChild)
at Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeWrapper.appendChild(IXMLDOMNode newChild)
at Req2.Req2.RemovePers_OnClick(DocActionEvent e) in c:\documents and settings\tc\bureau\st gallen\visual studio projects\req2\formcode.cs:line 128
at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)
my code is:
IXMLDOMNode loesch= thisXDocument.DOM.selectSingleNode("/CaseList/Case/AV/AVel/PersBisher/Person[Personalien/PersDaten = ../../../AVel/PersNeuMut/PersListe]");
IXMLDOMDocument domXMLNode = (IXMLDOMDocument)thisXDocument.CreateDOM();
domXMLNode.async = false;
domXMLNode.loadXML(loesch.xml);
IXMLDOMNode oParentNode = thisXDocument.DOM.selectSingleNode("/CaseList/Case/AV/AVel/PersNeuMut/Person");
oParentNode.appendChild(domXMLNode.documentElement);As you can see the Xmlnode is take in a node of the primary datasource and she is copy in another one so why that make this kind of error?
Thanks for your reply!
++
Thierry
Every moment hesitated is a moment gone for life!!! Think about it
Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
merci de lire ceci