<?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: Using XPath to find a specific node in a secondary datasource</title><link>https://www.infopathdev.com:443/forums/thread/62018.aspx</link><pubDate>Tue, 07 Dec 2010 16:53:43 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:62018</guid><dc:creator>Talvalin</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/62018.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=62018</wfw:commentRss><description>Thank you for your responses. I&amp;#39;ve since had to abandon this plan and have created another topic regarding the filtering of Sharepoint external lists here: &lt;a href="http://www.infopathdev.com/forums/t/17791.aspx"&gt;http://www.infopathdev.com/forums/t/17791.aspx&lt;/a&gt;</description></item><item><title>Re: Using XPath to find a specific node in a secondary datasource</title><link>https://www.infopathdev.com:443/forums/thread/61947.aspx</link><pubDate>Sat, 04 Dec 2010 16:54:02 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:61947</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/61947.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=61947</wfw:commentRss><description>&lt;p&gt;There are areas in browser forms where you can&amp;#39;t use filters, but you should be able to use them in the &lt;strong&gt;value&lt;/strong&gt; formula of a rule just fine.&lt;/p&gt;
&lt;p&gt;Most likely the reason your formula is not working is that it should be:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;font color="#a31515"&gt;/dfs:myFields/dfs:dataFields/tns:GetSitesByCompanyIdResponse/tns:GetSitesByCompanyIdResult/q1:Site/q1:AddressLine1[&lt;strong&gt;../q1:SiteId&lt;/strong&gt; = &lt;strong&gt;&lt;u&gt;siteId&lt;/u&gt;&lt;/strong&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;]&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;not that much longer version you have.&lt;/p&gt;</description></item><item><title>Re: Using XPath to find a specific node in a secondary datasource</title><link>https://www.infopathdev.com:443/forums/thread/61945.aspx</link><pubDate>Sat, 04 Dec 2010 12:28:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:61945</guid><dc:creator>Talvalin</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/61945.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=61945</wfw:commentRss><description>From what I&amp;#39;ve read on the net, this can be achieved using rules and filters but I&amp;#39;m using a browser-enabled form so filters won&amp;#39;t work right? I appreciate that I may not have a complete understanding of this problem as I&amp;#39;m very new to Infopath. 

The other problem I&amp;#39;ve encountered is that I can use rules to populate my site details, but I can only ever seem to populate details that correspond to the first site in the dropdown. Even if I choose a different site first, I only ever see the details for the first site. As a result of this, I&amp;#39;ve been trying to do this using code instead, but I&amp;#39;m encountering different problems now. 

If this can be achieved without code, then I&amp;#39;d love to do so. :)</description></item><item><title>Re: Using XPath to find a specific node in a secondary datasource</title><link>https://www.infopathdev.com:443/forums/thread/61936.aspx</link><pubDate>Fri, 03 Dec 2010 17:54:54 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:61936</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/61936.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=61936</wfw:commentRss><description>&lt;p&gt;Hi -- this can be done in code, but ... why? I mean, you could use rules for this. Rules would go on the field that the drop down is bound to, and you could select the field from your main data source as the target and the&amp;nbsp;field&amp;nbsp;you want from your secondary data source as the value. I must be missing a step in your description of your problem that would require code?&lt;/p&gt;</description></item><item><title>Using XPath to find a specific node in a secondary datasource</title><link>https://www.infopathdev.com:443/forums/thread/61935.aspx</link><pubDate>Fri, 03 Dec 2010 17:44:41 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:61935</guid><dc:creator>Talvalin</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/61935.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=61935</wfw:commentRss><description>&lt;p&gt;Hello!&lt;/p&gt;
&lt;p&gt;Background first:&amp;nbsp;I&amp;#39;ve got a form that is receiving data via a WCF webservice and is called GetSitesByCompanyId. The data is run on load (with a hardcoded company id for testing)&amp;nbsp;and&amp;nbsp;used to&amp;nbsp;populate a dropdown box of Site Names. What I&amp;#39;m trying to do is to use code to populate details for the site when a selection is made from the dropdown. I can match the site name with a site id (although this involved the possibly dodgy method of creating a dictionary of site name to site id and populating said dictionary on form load), but I cannot seem to formulate an XPath query that will find the appropriate details in the result set for the given site id. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;Here&amp;#39;s the code that I have. Any help would be greatly appreciated! If nothing else, a method for shortening the absolute paths I&amp;#39;m using would be good. :)&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;/////////////////////////////&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Set the site detail fields&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;DataSource&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; dsSites = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.DataSources[&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;GetSitesByCompanyId&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;];&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; xnSites = dsSites.CreateNavigator();&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; addressLine1 = MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/my:myFields/my:SiteDetails/my:group4/my:AddressLine1&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, ns);&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; addressLineResult = xnSites.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/dfs:myFields/dfs:dataFields/tns:GetSitesByCompanyIdResponse/tns:GetSitesByCompanyIdResult/q1:Site/q1:AddressLine1[/dfs:myFields/dfs:dataFields/tns:GetSitesByCompanyIdResponse/tns:GetSitesByCompanyIdResult/q1:Site/q1:SiteId=\&amp;quot;&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; + siteId.ToString() + &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;\&amp;quot;])&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, ns);&lt;/p&gt;&lt;/font&gt;</description></item></channel></rss>