<?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: Email Data in Current Section of Repeating Section</title><link>https://www.infopathdev.com:443/forums/thread/44495.aspx</link><pubDate>Thu, 16 Jul 2009 19:24:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44495</guid><dc:creator>JFlye</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44495.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=44495</wfw:commentRss><description>&lt;p&gt;Sorry to multiple post, but Ive learned some things about my issue and I thought it might help anyone who gets the chance to help me!&lt;/p&gt;
&lt;p&gt;The &amp;quot;Current Position&amp;quot; field, which holds my &amp;quot;count(preceding-sibling::ActionItems) + 1&amp;quot; equation does get the right number, but like my other fields must be filtered to the appropriate node to give me that number (i.e. /my:CurrentPosition = 1 even if I have 2 nodes on the form; yet /my:CurrentPosition[2] = 2). So really this doesnt help me, as my original problem still stands - how to filter to that node!&lt;/p&gt;
&lt;p&gt;I am looking for one of two solutions (that I can think of):&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;div&gt;Be able to declare a variable in my VBScript for the button that I can pass into the filter (i.e. /my:CurrentPosition[&lt;em&gt;variable&lt;/em&gt;] )&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Find a way in XPath to reference my current node (I have tried&amp;nbsp; /my:CurrentPosition[position()]&amp;nbsp; with no effect&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;I would really appreciate anyone&amp;#39;s help! &lt;/p&gt;</description></item><item><title>Re: Email Data in Current Section of Repeating Section</title><link>https://www.infopathdev.com:443/forums/thread/44460.aspx</link><pubDate>Thu, 16 Jul 2009 13:27:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44460</guid><dc:creator>JFlye</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44460.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=44460</wfw:commentRss><description>&lt;p&gt;Thank you so much for your reply! I appreciate your help!&lt;/p&gt;
&lt;p&gt;From the above link and Greg&amp;#39;s blog, I now have a field &amp;quot;Current Position&amp;quot;&amp;nbsp;whose default value is&amp;nbsp;count(preceding-sibling::ActionItems) + 1 to determine the number of nodes in the repeating section &amp;quot;ActionItems&amp;quot;.&lt;/p&gt;
&lt;p&gt;I am having difficulty, however, filtering by that number to reach the current node. I cannot seem to reference it correctly in my Xpath. My code now looks like this:&lt;/p&gt;
&lt;p&gt;titlevar = XDocument.DOM.selectSingleNode(&amp;quot;/my:Effort/my:Action/my:ActionItemsOpt/my:ActionItems[number(../my:CurrentPosition)]/my:ActionTitle&amp;quot;).text &lt;br /&gt;descripvar = XDocument.DOM.selectSingleNode(&amp;quot;/my:Effort/my:Action/my:ActionItemsOpt/my:ActionItems[number(../my:CurrentPosition)]/my:ActionDescription&amp;quot;).text &lt;br /&gt;duedatevar = XDocument.DOM.selectSingleNode(&amp;quot;/my:Effort/my:Action/my:ActionItemsOpt/my:ActionItems[number(../my:CurrentPosition)]/my:ActionDueDate&amp;quot;).text&lt;br /&gt;...&lt;/p&gt;
&lt;p&gt;I would really appreciate any help you have!&lt;/p&gt;</description></item><item><title>Re: Email Data in Current Section of Repeating Section</title><link>https://www.infopathdev.com:443/forums/thread/44448.aspx</link><pubDate>Thu, 16 Jul 2009 09:14:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44448</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44448.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=44448</wfw:commentRss><description>&lt;p&gt;have you looked at Greg&amp;#39;s examples on position()? &lt;a href="http://www.infopathdev.com/files/folders/examples/entry277.aspx"&gt;http://www.infopathdev.com/files/folders/examples/entry277.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You should also search for &amp;quot;axis&amp;quot; and read Greg&amp;#39;s blog on that if the link above doesn&amp;#39;t help elucidate.&lt;/p&gt;</description></item><item><title>Email Data in Current Section of Repeating Section</title><link>https://www.infopathdev.com:443/forums/thread/44426.aspx</link><pubDate>Thu, 16 Jul 2009 00:38:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44426</guid><dc:creator>JFlye</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44426.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=44426</wfw:commentRss><description>&lt;p&gt;Hi everyone,&lt;/p&gt;
&lt;p&gt;I have been pulling my hair out and searching everywhere, but I cannot figure out what is going wrong here. I have a repeating section with a series of fields, which I would like to have their contents emailed to a specific user. Within the repeating section (at the bottom), is the &amp;quot;Email&amp;quot; button, which should grab the fields in the section relative to itself and email them off.&lt;/p&gt;
&lt;p&gt;I think Ive narrowed my problem down to that wonderful &amp;quot;position()&amp;quot; function. The result of the button is that it successfully emails with all the correct fields the &lt;strong&gt;first&lt;/strong&gt; action item &lt;strong&gt;every&lt;/strong&gt; single time.&lt;/p&gt;
&lt;p&gt;Here is my code (I am using VBScript and InfoPath 2007):&lt;/p&gt;
&lt;p&gt;titlevar = XDocument.DOM.selectSingleNode(&amp;quot;/my:Effort/my:Action/my:ActionItemsOpt/my:ActionItems/my:ActionTitle[position()]&amp;quot;).text &lt;br /&gt;descripvar = XDocument.DOM.selectSingleNode(&amp;quot;/my:Effort/my:Action/my:ActionItemsOpt/my:ActionItems/my:ActionDescription[position()]&amp;quot;).text &lt;br /&gt;duedatevar = XDocument.DOM.selectSingleNode(&amp;quot;/my:Effort/my:Action/my:ActionItemsOpt/my:ActionItems/my:ActionDueDate[position()]&amp;quot;).text &lt;br /&gt;priorityvar = XDocument.DOM.selectSingleNode(&amp;quot;/my:Effort/my:Action/my:ActionItemsOpt/my:ActionItems/my:ActionPriority[position()]&amp;quot;).text &lt;br /&gt;efforttitle = XDocument.DOM.selectSingleNode(&amp;quot;/my:Effort/my:Definition/my:Title&amp;quot;).text &lt;br /&gt;actionitemnum = XDocument.DOM.selectSingleNode(&amp;quot;/my:Effort/my:Action/my:ActionItemsOpt/my:ActionItems/my:CurrentPosition[position()]&amp;quot;).text &lt;br /&gt;CORPactionowner = XDocument.DOM.selectSingleNode(&amp;quot;/my:Effort/my:Action/my:ActionItemsOpt/my:ActionItems/my:AssignedToCORP[position()]&amp;quot;).text &lt;br /&gt;EXTactionowner = XDocument.DOM.selectSingleNode(&amp;quot;/my:Effort/my:Action/my:ActionItemsOpt/my:ActionItems/my:AssignedToExt[position()]&amp;quot;).text &lt;br /&gt;ownerspace = XDocument.DOM.selectSingleNode(&amp;quot;/my:Effort/my:Action/my:ActionItemsOpt/my:ActionItems/my:AssignedToSpace[position()]&amp;quot;).text &lt;br /&gt;EXTemail = XDocument.DOM.selectSingleNode(&amp;quot;/my:Effort/my:Action/my:ActionItemsOpt/my:ActionItems/my:EXTemail[position()]&amp;quot;).text&lt;/p&gt;</description></item></channel></rss>