<?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: Using deep parameter of clonenode to recursively clone all descendant nodes</title><link>https://www.infopathdev.com:443/forums/thread/22697.aspx</link><pubDate>Tue, 28 Aug 2007 14:52:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22697</guid><dc:creator>spudy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22697.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22697</wfw:commentRss><description>&lt;p&gt;When I looked at the code to figure out what would be needed to replicate this issue in order to post more information here I discovered the problem!&lt;/p&gt;
&lt;p&gt;There is&amp;nbsp;not much that can&amp;nbsp;beat taking a fresh look from a different perspective.&lt;/p&gt;
&lt;p&gt;My clone node line of code:&lt;/p&gt;
&lt;p&gt;var oldRow = nodeList.item(i).selectSingleNode(&amp;quot;//my:FirstGroup/my:FirstRepeatingGroup&amp;quot;); &lt;/p&gt;
&lt;p&gt;should have been &lt;/p&gt;
&lt;p&gt;var oldRow = nodeList.item(i)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;There after I simply added the clone node:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;var parent = oldRow.parentNode; &lt;/p&gt;
&lt;p&gt;var tempValues = XDocument.DOM.selectSingleNode(&amp;quot;//my:TemporaryValues&amp;quot;); &lt;/p&gt;
&lt;p&gt;parent.insertBefore(newRow, tempValues); &lt;/p&gt;
&lt;p&gt;Thankyou for making me revisit from a different angle.......&lt;/p&gt;</description></item><item><title>Re: Using deep parameter of clonenode to recursively clone all descendant nodes</title><link>https://www.infopathdev.com:443/forums/thread/22691.aspx</link><pubDate>Tue, 28 Aug 2007 11:47:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22691</guid><dc:creator>Agni Jonnalagadda</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22691.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22691</wfw:commentRss><description>&lt;p&gt;Hi,&lt;br /&gt;When deep is set to true then repeating nodes also get copied. Code provided below does not give anough information. If you can provide with more code then we might be able to help you.&lt;/p&gt;</description></item><item><title>Using deep parameter of clonenode to recursively clone all descendant nodes</title><link>https://www.infopathdev.com:443/forums/thread/22682.aspx</link><pubDate>Tue, 28 Aug 2007 09:48:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22682</guid><dc:creator>spudy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22682.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22682</wfw:commentRss><description>&lt;p&gt;Can anyone help with this?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am using clonenode to create a same as function within my form. Once a user has gathered lots of information and then wishes to start a new record but using previous detail as a starting point,a same as function&amp;nbsp;is used calling&amp;nbsp;the clone function.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The code for performing the clone does work&amp;nbsp;but it is not working for repeating groups within the parent. For example:&lt;/p&gt;
&lt;p&gt;myFields/FirstGroup/FirstRepeatingGroup&amp;nbsp;contains a group /SecondGroup/SecondRepeatingGroup - if rows exist in the SecondRepeatingGroup they do not get cloned - only the first blank row exists.&lt;/p&gt;
&lt;p&gt;The clonenode is using (true) to set the deep parameter but does not seem to clone the repeating group.&lt;/p&gt;
&lt;p&gt;The code goes like this:&lt;/p&gt;
&lt;p&gt;var nodeList = XDocument.DOM.selectNodes(&amp;quot;my:myFields/my:FirstGroup/my:FirstRepeatingGroup&amp;quot;); &lt;/p&gt;
&lt;p&gt;for ( var i = 0; i &amp;lt; nodeList.length; i++) &lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&amp;nbsp;var RowIDfield = nodeList.item(i).selectSingleNode(&amp;quot;my:RowID&amp;quot;); &lt;/p&gt;
&lt;p&gt;//Check if ID matches the Same As selection &lt;/p&gt;
&lt;p&gt;if ( RowIDfield.nodeTypedValue == tempNode.text ) &lt;/p&gt;
&lt;p&gt;{ &lt;/p&gt;
&lt;p&gt;var oldRow = nodeList.item(i).selectSingleNode(&amp;quot;//my:FirstGroup/my:FirstRepeatingGroup&amp;quot;); &lt;/p&gt;
&lt;p&gt;var newRow = oldRow.cloneNode(true); &lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards Spudy&lt;/p&gt;</description></item></channel></rss>