<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Error in code</title><link>https://www.infopathdev.com:443/forums/thread/13897.aspx</link><pubDate>Thu, 03 Nov 2005 06:07:33 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13897</guid><dc:creator>Coita Thierry</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13897.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13897</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;Thanks for the reply! &lt;br /&gt;&lt;br /&gt;Great software AndersR I will try it!&lt;br /&gt;&lt;br /&gt;Ok so I have make an error in &lt;br /&gt;&lt;pre&gt;IXMLDOMNode NewMuster = newDocument.selectSingleNode("/");&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I select the entire xml with the declaration line and infopath say that I can replace by a complete XML!&lt;br /&gt;&lt;br /&gt;So if I do:&lt;br /&gt;&lt;pre&gt;IXMLDOMNode NewMuster = newDocument.selectSingleNode("/Case");&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;That works!&lt;br /&gt;&lt;br /&gt;Stupid error but interessant answer thanks one more times!&lt;br /&gt;&lt;br /&gt;++&lt;br /&gt;&lt;br /&gt;Thierry&lt;br /&gt;&lt;br /&gt;Every moment hesitated is a moment gone for life!!! Think about it</description></item><item><title>Re: Error in code</title><link>https://www.infopathdev.com:443/forums/thread/13896.aspx</link><pubDate>Wed, 02 Nov 2005 20:44:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13896</guid><dc:creator>Agni Jonnalagadda</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13896.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13896</wfw:commentRss><description>Hi Thierry,&lt;br /&gt;Try this out for the last two lines&lt;br /&gt;IXMLDOMNode NewMuster = newDocument.documentElement;&lt;br /&gt;Muster.parentNode.replaceChild(NewMuster, Muster);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Agni&lt;br /&gt;InfoPath Dev India</description></item><item><title>Re: Error in code</title><link>https://www.infopathdev.com:443/forums/thread/13895.aspx</link><pubDate>Wed, 02 Nov 2005 13:53:09 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13895</guid><dc:creator>AndersR</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13895.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13895</wfw:commentRss><description>Could you try fetching the stack trace of the exception.&lt;br /&gt;&lt;br /&gt;That would make debugging alot easier.&lt;br /&gt;&lt;br /&gt;put try catch around the code and in the general exception e (or ArgumentException e) write&lt;br /&gt;&lt;br /&gt;System.Diagnostics.Trace.WriteLine(e.StackTrace);&lt;br /&gt;&lt;br /&gt;Check the debug output with any system output viewer. I prefer DebugView by SystemInternals:&lt;br /&lt;a target="_blank" href=http://www.sysinternals.com/Utilities/DebugView.html&gt;http://www.sysinternals.com/Utilities/DebugView.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I use this method alot when working with smart clients or sharepoint.&lt;br /&gt;&lt;br /&gt;Be aware that the above data will only be intercepted if you build in debug mode (as in not release mode)&lt;br /&gt;&lt;br /&gt;hth&lt;br /&gt;//AndersR&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</description></item><item><title>Error in code</title><link>https://www.infopathdev.com:443/forums/thread/12653.aspx</link><pubDate>Wed, 02 Nov 2005 12:35:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12653</guid><dc:creator>Coita Thierry</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12653.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12653</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;I have some probleme I wan't to replace a node in my form but I don't how if I try like this:&lt;br /&gt;&lt;pre&gt;IXMLDOMNode Muster = thisXDocument.DOM.selectSingleNode("/Essai/Muster");&lt;br /&gt;string xml =Muster.xml;&lt;br /&gt;XmlDocument oldMuster = new XmlDocument();&lt;br /&gt;oldMuster.LoadXml(xml);&lt;br /&gt;XPathNavigator oldMuster2 = oldMuster.CreateNavigator();&lt;br /&gt;XslTransform xslt = new XslTransform();&lt;br /&gt;xslt.Load("mustertransform.xsl");&lt;br /&gt;XmlUrlResolver resolve= new XmlUrlResolver();&lt;br /&gt;StringWriter result= new StringWriter();&lt;br /&gt;xslt.Transform(oldMuster2,null,result, resolve);&lt;br /&gt;		&lt;br /&gt;IXMLDOMDocument2 newDocument = (IXMLDOMDocument2)thisXDocument.CreateDOM();&lt;br /&gt;newDocument.loadXML(result.ToString());&lt;br /&gt;			&lt;br /&gt;IXMLDOMNode NewMuster = newDocument.selectSingleNode("/");&lt;br /&gt;&lt;br /&gt;Muster.parentNode.replaceChild(NewMuster, Muster);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;But that make me the following error:&lt;br /&gt; &lt;blockquote id="quote"&gt;&lt;font size="1" face="Verdana, Arial, Helvetica" id="quote"&gt;quote:&lt;hr height="1" noshade id="quote"&gt;System.ArgumentException&lt;br /&gt;This operation can not be performed with a Node of type DOCUMENT.&lt;br /&gt;&lt;hr height="1" noshade id="quote"&gt;&lt;/font id="quote"&gt;&lt;/blockquote id="quote"&gt;&lt;br /&gt;The error is made by the last line! &lt;br /&gt;&lt;br /&gt;Any Idea about what is the problem?&lt;br /&gt;&lt;br /&gt;Thanks for your help!&lt;br /&gt;&lt;br /&gt;++&lt;br /&gt;&lt;br /&gt;Thierry&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Every moment hesitated is a moment gone for life!!! Think about it</description></item></channel></rss>