<?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>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Preceding-sibling Optional Section</title><link>https://www.infopathdev.com:443/forums/thread/80178.aspx</link><pubDate>Tue, 03 Jul 2012 22:29:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80178</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80178.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=80178</wfw:commentRss><description>&lt;p&gt;See attached - save the file locally, then right click the saved file and select Design to open in design mode.&lt;/p&gt;
&lt;p&gt;I used an expression box for this in my sample instead of a field - I&amp;#39;d think given the structure you describe, the XPath would be:&lt;/p&gt;
&lt;p&gt;count(../../preceding-sibling::my:RepeatingSection/my:OptionalSection) + 1&lt;/p&gt;</description></item><item><title>Preceding-sibling Optional Section</title><link>https://www.infopathdev.com:443/forums/thread/80115.aspx</link><pubDate>Tue, 03 Jul 2012 07:03:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80115</guid><dc:creator>Debster</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80115.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=80115</wfw:commentRss><description>&lt;p&gt;I&amp;#39;ve got a form with the following layout:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;MyFields:&lt;/p&gt;
&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;Textfield1&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;RepeatingSection&lt;/div&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;OptionalSection&lt;/div&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;Textfield2&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/blockquote&gt;
&lt;p&gt;What I would like to do is create a sort of autonumbering of the OptionalSection into Textfield2. I&amp;#39;ve tried to insert the following formula into Textfield2:&amp;nbsp;&lt;strong&gt;&lt;em&gt;count(preceding-sibling::*/my:OptionalSection)&lt;/em&gt;&lt;/strong&gt;, but it doesn&amp;#39;t work.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Can somebody help me with this problem.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>