<?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>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: selectSingleNode for all records in data source</title><link>https://www.infopathdev.com:443/forums/thread/30898.aspx</link><pubDate>Mon, 28 Jul 2008 05:06:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30898</guid><dc:creator>PJagger</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30898.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=30898</wfw:commentRss><description>&lt;p&gt;Hey Josh,&lt;/p&gt;
&lt;p&gt;That did it! Thank you!&amp;nbsp; &amp;amp; Thank you Hilary!&amp;nbsp; You have both helped me enormously!&lt;/p&gt;
&lt;p&gt;Regards - Phil&lt;/p&gt;</description></item><item><title>Re: selectSingleNode for all records in data source</title><link>https://www.infopathdev.com:443/forums/thread/30897.aspx</link><pubDate>Mon, 28 Jul 2008 04:29:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30897</guid><dc:creator>JoshuaWeir</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30897.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=30897</wfw:commentRss><description>&lt;span style="FONT-SIZE:11pt;COLOR:#1f497d;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;Try doing this:&lt;/span&gt;&lt;span style="FONT-SIZE:11pt;COLOR:#1f497d;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;&amp;nbsp;&lt;/span&gt; 
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Times New Roman"&gt;var Records = XDocument.DOM.selectNodes&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Times New Roman"&gt;(&amp;quot;/my:myFields/my:Itemisations/my:ItemisationsTable&amp;quot;); &lt;/font&gt;&lt;/span&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Times New Roman"&gt;for (var i=0; i &amp;lt; Records.length; i++) &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Times New Roman"&gt;{ &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Times New Roman"&gt;FileObject.Write(Records[i].selectSingleNode(&amp;quot;my:AllocationDetails/my:PaymentMethod&amp;quot;).text + &amp;quot;\t&amp;quot;); &lt;/font&gt;&lt;/span&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Times New Roman"&gt;//…then repeat this for all the other fields except the last one&amp;nbsp;…..&lt;/font&gt;&lt;/span&gt; 
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Times New Roman"&gt;//..then for the last one ensure you put the newline characters instead of the tab:&lt;/font&gt;&lt;/span&gt; 
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Times New Roman"&gt;FileObject.Write(Records[i].selectSingleNode(&amp;quot;my:AllocationDetails/my:YourLastField&amp;quot;).text + &amp;quot;\r” + “\n”); &lt;/font&gt;&lt;/span&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;}&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: selectSingleNode for all records in data source</title><link>https://www.infopathdev.com:443/forums/thread/30896.aspx</link><pubDate>Mon, 28 Jul 2008 01:00:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30896</guid><dc:creator>PJagger</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30896.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=30896</wfw:commentRss><description>&lt;p&gt;Okay Hilary,&lt;/p&gt;
&lt;p&gt;Tried your suggestion, at first&amp;nbsp;it was not writing anything, however, I replaced [i] in the var blah line with 0 then 1 and yes it was writing the selected row accordingly.&amp;nbsp; I changed it back to [i] and its working!??&amp;nbsp; Thank you big time!&lt;/p&gt;
&lt;p&gt;I am hampered by my next step however,&amp;nbsp; I am trying to write a row of fields from a repeating table separated by tabs (&amp;quot;\t&amp;quot;) and then start a new line (&amp;quot;\r&amp;quot; + &amp;quot;\n&amp;quot;) before the next row of data is written and so forth&amp;nbsp; In others words, a tab delimited text file output.&amp;nbsp; I can&amp;#39;t seem to enable my var blah to include the tab and&amp;nbsp;another field.&lt;/p&gt;
&lt;p&gt;Please advise.&lt;/p&gt;
&lt;p&gt;Regards - Phil&lt;/p&gt;</description></item><item><title>Re: selectSingleNode for all records in data source</title><link>https://www.infopathdev.com:443/forums/thread/30893.aspx</link><pubDate>Sun, 27 Jul 2008 23:59:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30893</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30893.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=30893</wfw:commentRss><description>&lt;p&gt;Oh, sure. I mean the code above should read thus:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;var Records = XDocument.DOM.selectNodes(&amp;quot;/my:myFields/my:Itemisations/my:ItemisationsTable&amp;quot;); &lt;/p&gt;
&lt;p&gt;for (var i=0; i &amp;lt; Records.length; i++) &lt;/p&gt;
&lt;p&gt;{ &lt;/p&gt;
&lt;p&gt;var blah = Records[i].selectSingleNode(&amp;quot;my:AllocationDetails/my:PaymentMethod&amp;quot;); &lt;/p&gt;
&lt;p&gt;//note that the below I have used for debugging to verify the value of the field.....&amp;nbsp;&lt;/p&gt;
&lt;p&gt;//FileObject.Write(blah.text + &amp;quot;\t&amp;quot;); &lt;/p&gt;
&lt;p&gt;&amp;nbsp;}&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Because, you see, your variable called Records refers to the ItemisationsTable node. So, as you iterate through, you want to be setting your new variable to the PaymentMethod node that belongs to the record node you are currently looking at....&lt;/p&gt;</description></item><item><title>Re: selectSingleNode for all records in data source</title><link>https://www.infopathdev.com:443/forums/thread/30892.aspx</link><pubDate>Sun, 27 Jul 2008 23:00:59 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30892</guid><dc:creator>PJagger</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30892.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=30892</wfw:commentRss><description>&lt;p&gt;Hi Hilary&lt;/p&gt;
&lt;p&gt;Thanks for your reply.&amp;nbsp; I still need further directions.&amp;nbsp; What do you mean by so: &amp;quot;my:AllocationDetails/my:PaymentMethod&amp;quot;?&lt;/p&gt;
&lt;p&gt;Appreciate your help&lt;/p&gt;
&lt;p&gt;Phil&lt;/p&gt;</description></item><item><title>Re: selectSingleNode for all records in data source</title><link>https://www.infopathdev.com:443/forums/thread/30887.aspx</link><pubDate>Sun, 27 Jul 2008 13:41:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30887</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30887.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=30887</wfw:commentRss><description>For &amp;quot;blah&amp;quot; you are iterating through all the records nodes and then going back up to your main node to select the value -- which always returns the first value. The selectSingleNode for that variable should be from Records[i], so: &amp;quot;my:AllocationDetails/my:PaymentMethod&amp;quot;</description></item><item><title>selectSingleNode for all records in data source</title><link>https://www.infopathdev.com:443/forums/thread/30884.aspx</link><pubDate>Sun, 27 Jul 2008 07:47:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30884</guid><dc:creator>PJagger</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30884.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=30884</wfw:commentRss><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I want to get the value of a field for all records in a repeating table. In my current repeating table there are 3 records. &lt;/p&gt;
&lt;p&gt;I use the following code to try to retrieve the value of the field for each record but it only ever gets the value of the 1st record in the repeating table:&lt;/p&gt;
&lt;p&gt;var Records = XDocument.DOM.selectNodes(&amp;quot;/my:myFields/my:Itemisations/my:ItemisationsTable&amp;quot;); &lt;/p&gt;
&lt;p&gt;for (var i=0; i &amp;lt; Records.length; i++) &lt;/p&gt;
&lt;p&gt;{ &lt;/p&gt;
&lt;p&gt;var blah = Records[i].selectSingleNode(&amp;quot;/my:myFields/my:Itemisations/my:ItemisationsTable/my:AllocationDetails/my:PaymentMethod&amp;quot;); &lt;/p&gt;
&lt;p&gt;//note that the below I have used for debugging to verify the value of the field.....&amp;nbsp;&lt;/p&gt;
&lt;p&gt;//FileObject.Write(blah.text + &amp;quot;\t&amp;quot;); &lt;/p&gt;
&lt;p&gt;&amp;nbsp;}&lt;/p&gt;
&lt;p&gt;What am I doing wrong here? It is only ever showing the field value of the 1st record in the repeating table???&lt;/p&gt;</description></item></channel></rss>