<?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: How do I get the xpath that populates one field so I can use it to populate another</title><link>https://www.infopathdev.com:443/forums/thread/68989.aspx</link><pubDate>Thu, 04 Aug 2011 18:27:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:68989</guid><dc:creator>enthdegree_</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/68989.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=68989</wfw:commentRss><description>&lt;p&gt;Amazing, this worked flawlessly. &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks a million! &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: How do I get the xpath that populates one field so I can use it to populate another</title><link>https://www.infopathdev.com:443/forums/thread/68988.aspx</link><pubDate>Thu, 04 Aug 2011 18:27:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:68988</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/68988.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=68988</wfw:commentRss><description>&lt;p&gt;You just need to use rules for this. Nothing fancy, no code needed.&lt;/p&gt;
&lt;p&gt;The rule should be on the&amp;nbsp;field in the main data source that is using the XML for the drop down values.&lt;/p&gt;
&lt;p&gt;The rule needs to set the valud of your main data source field that is bound to the text box to the value of Weight from your secondary data source where the Model in the 2ds is equal to the Model selected. We are adding a filter to our selected field to let InfoPath know what row in the 2DS our data should come from.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m attaching a simple sample form. Right click the link in the heading, save the file down and right click again to select Design to open in design mode. Preview to see it in action. The rule is on the Model field.&lt;/p&gt;</description></item><item><title>How do I get the xpath that populates one field so I can use it to populate another</title><link>https://www.infopathdev.com:443/forums/thread/68987.aspx</link><pubDate>Thu, 04 Aug 2011 18:11:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:68987</guid><dc:creator>enthdegree_</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/68987.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=68987</wfw:commentRss><description>&lt;p&gt;Hello everyone,&lt;/p&gt;

&lt;p&gt;I know the title is confusing so let me try to give some background for what I am trying to do. I have a big XML file containing data according to the following schema (greatly simplified for the sake of this post): &lt;/p&gt;

&lt;p&gt;&lt;code&gt;
&amp;lt;xs:schema id=&amp;quot;GrenadeSchema&amp;quot;&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;&amp;nbsp; &amp;lt;xs:element name=&amp;quot;GrenadeList&amp;quot;&amp;gt;
    &lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:complextype&amp;gt;
      &lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:sequence&amp;gt;
&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:element name=&amp;quot;Grenade&amp;quot; maxoccurs=&amp;quot;unbounded&amp;quot;&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:complextype&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:sequence&amp;gt;
&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:element name=&amp;quot;Model&amp;quot; type=&amp;quot;xs:string&amp;quot; minoccurs=&amp;quot;0&amp;quot;&amp;gt;&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:element name=&amp;quot;Weight&amp;quot; type=&amp;quot;xs:int&amp;quot; minoccurs=&amp;quot;0&amp;quot;&amp;gt;
            &lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:element name=&amp;quot;canMakeThingsExplode&amp;quot; type=&amp;quot;xs:boolean&amp;quot; minoccurs=&amp;quot;0&amp;quot;&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:sequence&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;lt;/xs:complexType&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:element&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:sequence&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:complextype&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;&amp;nbsp; &amp;lt;/xs:element&amp;gt;
      &lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;&amp;lt;/xs:schema&amp;gt;
&lt;/code&gt;&lt;/p&gt;&lt;p&gt;...and over in my InfoPath form I have a dropdown box who&amp;#39;s data source is the XML file mentioned above. It&amp;#39;s populated by the &amp;#39;Model&amp;#39; element so when I click on it, I can choose from many different models of grenades.&lt;/p&gt;&lt;p&gt;I also have a text box and a check box that I&amp;#39;d like to populate depending on what model is selected using the other elements in the repeating group.&amp;nbsp;&lt;/p&gt;&lt;p&gt;My first impression is to modify the text box/check box&amp;#39;s xpath to somehow change to the dropdown box&amp;#39;s current xpath context, ascend, then descend into the corresponding element. I looked but unfortunately couldn&amp;#39;t find a way to do that.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;It would be totally okay to use C# code as this form needs full trust and is signed anyway. If necessary, I can change the XML document&amp;#39;s schema. If I /absolutely had to/ I could read my XML file into a database but it would be pretty sloppy given what this will be used for. (not for grenades this time, unfortunately (;)&lt;/p&gt;&lt;p&gt;Thank you! &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>