<?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: Add repeating table data to main data source from secondary data source</title><link>https://www.infopathdev.com:443/forums/thread/43635.aspx</link><pubDate>Tue, 30 Jun 2009 19:20:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:43635</guid><dc:creator>mtbikerj</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/43635.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=43635</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Thanks.&amp;nbsp; I understand your method, but I am not able to use &amp;quot;foreach.&amp;quot;&amp;nbsp; It gives me a syntax error.&amp;nbsp; I may have forgotten to mention that I&amp;#39;m using infopath 2003 as I&amp;#39;m sure that makes a difference.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Add repeating table data to main data source from secondary data source</title><link>https://www.infopathdev.com:443/forums/thread/43631.aspx</link><pubDate>Tue, 30 Jun 2009 18:53:59 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:43631</guid><dc:creator>Shiva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/43631.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=43631</wfw:commentRss><description>&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;Hello,&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;We can do it using Jscript code, first you have to get the list from secondary source and set those values to one temporary node and these nodes should get added to parent node.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;var secondaryRepeatingNodes = XDocument.GetDOM(“Seconday DOM Name”).selectNodes(“Secondary XPath of the repeating nodes”);&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;var parentNode = XDocument.DOM.selectSingleNode(“Repeating Parent Node XPath”);&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;var repeatingNode = XDocument.DOM.selectSingleNode(“Repeating Node XPath”);&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;var tempRepeatingNode = repeatingNode.cloneNode(true);&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;foreach (var secondaryRepeatingNode in secondaryRepeatingNodes)&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;{&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;var value = secondaryRepeatingNode.selectSingleNode(“XPath of one node in secondary XML”);&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;tempRepeatingNode. selectSingleNode(“XPath of need to set value”).text = value;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;//Like this you have add more number node values&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;repeatingNode.appendChild(tempRepeatingNode);&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;tempRepeatingNode = repeatingNode.cloneNode(true);&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;}&lt;/font&gt;&lt;/p&gt;</description></item><item><title>Add repeating table data to main data source from secondary data source</title><link>https://www.infopathdev.com:443/forums/thread/43627.aspx</link><pubDate>Tue, 30 Jun 2009 17:12:09 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:43627</guid><dc:creator>mtbikerj</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/43627.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=43627</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m very new to programming in jscript so heres what I&amp;#39;m trying to do.&lt;/p&gt;&lt;p&gt;I have an XML list as a secondary data source with the lines that I want to collect from users and there are several calculations that I want to do on that data (sum, percent, etc...).&amp;nbsp; I have created a repeating table in the main data source and want lines inserted and the first column of the main data source to be populated with the items from the secondary data source.&lt;/p&gt;&lt;p&gt;&amp;nbsp;So the basic steps that I need are.&amp;nbsp; 1)&amp;nbsp; Insert lines to the repeating table for the number of lines in the secondary data source.&amp;nbsp; 2)&amp;nbsp; Set the text in a node of the repeating table equal to the node in the secondary data source.&amp;nbsp; 3)&amp;nbsp; don&amp;#39;t allow the users to insert any more lines.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Is there a way to do this using jscript or am I out of luck? &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>