Hi,
I have some problem with my code what I try to do is replace the node of my second form by the node of my first form!
Here is my code:
ch.powernet.zefix3.GVZ NewTrans = new ch.powernet.zefix3.GVZ();
XmlDocument XmlSave = new XmlDocument();
XmlSave.LoadXml(thisXDocument.DOM.xml.ToString());
XPathNavigator XMLF = XmlSave.CreateNavigator();
XslTransform xslt = new XslTransform();
xslt.Load("nonamespace.xsl");
XmlUrlResolver resolve= new XmlUrlResolver();
StringWriter result= new StringWriter();
xslt.Transform(XMLF,null,result, resolve);
//appel WS et résultat du WS
string sendWS =result.ToString();
XmlNode resultWS = NewTrans.putGVZAV(sendWS, "2" );
XDocument oXdNewForm = thisApplication.XDocuments.NewFromSolution(@"C:\Program Files\InfopathPow\AV.xsn");
IXMLDOMDocument2 newDocument = (IXMLDOMDocument2)thisXDocument.CreateDOM();
newDocument.loadXML(resultWS.OuterXml);
newDocument.setProperty("SelectionNamespaces",
"xmlns:xsf=\"http://schemas.microsoft.com/office/infopath/2003/solutionDefinition\" , ..."");
IXMLDOMNode oNode = newDocument.selectSingleNode("/Case");
IXMLDOMNode AV = oXdNewForm.DOM.selectSingleNode("/CaseList/Case");
AV.replaceChild(oNode, AV);
thisApplication.XDocuments.Close(0);
If I try to do this code that make me an error in line:
AV.replaceChild(oNode, AV);
the error is: Insert position Node must be a Child of the Node to insert under.
So I have think that is because I need to select the parent node I have try:
IXMLDOMNode AV = oXdNewForm.DOM.selectSingleNode("/CaseList");But always the same error!
Any Idea for this problem?
If you have any other suggestion for improve my code don't hesitate: post!
Thanks for your help
++
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