<?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: Xpath statement referencing 2 different data sources</title><link>https://www.infopathdev.com:443/forums/thread/35423.aspx</link><pubDate>Sun, 07 Dec 2008 18:35:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:35423</guid><dc:creator>Greg S</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/35423.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=35423</wfw:commentRss><description>&lt;p&gt;Thank you!&amp;nbsp; I didn&amp;#39;t know about get-DOM() -- and so easy to avoid notice when I&amp;#39;m used to using GetDOM(&amp;quot;xx&amp;quot;).&amp;nbsp; Works like a charm.&lt;/p&gt;</description></item><item><title>Re: Xpath statement referencing 2 different data sources</title><link>https://www.infopathdev.com:443/forums/thread/35411.aspx</link><pubDate>Sat, 06 Dec 2008 18:35:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:35411</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/35411.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=35411</wfw:commentRss><description>&lt;p&gt;For the main data source, xdXDocument:get-DOM() should do the trick:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;xdXDocument:GetDOM(&amp;quot;connection 1&amp;quot;)/dfs:myFields/dfs:dataFields/dfs:myRecord[@ID = xdXDocument:get-DOM()/my:myFields/my:mainID]/@Title&amp;nbsp;&lt;/p&gt;&lt;/blockquote&gt;</description></item><item><title>Re: Xpath statement referencing 2 different data sources</title><link>https://www.infopathdev.com:443/forums/thread/35410.aspx</link><pubDate>Sat, 06 Dec 2008 18:24:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:35410</guid><dc:creator>Greg S</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/35410.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=35410</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/infopathdev/images/icon-quote.gif"&gt; &lt;strong&gt;Jimmy:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; 
&lt;p&gt;Generally you should be able to accomplish it with something like this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;xdXDocument:GetDOM(&amp;quot;Data connection 1&amp;quot;)/dfs:myFields/dfs:dataFields/dfs:myRecord[@ID = &lt;strong&gt;xdXDocument:GetDOM(&amp;quot;Data connection 2&amp;quot;)/&lt;em&gt;path/to/other/field&lt;/em&gt;&lt;/strong&gt;]/@Title&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;I should add one other caveat, the 2nd data connection is the Main data source, and I can&amp;#39;t get xdXDocument:GetDOM to work against the Main data source.&amp;nbsp; I&amp;#39;ve tried xdXDocument:GetDOM(&amp;quot;&amp;quot;) and xdXDocument:GetDOM (&amp;quot;Main&amp;quot;).&amp;nbsp; I if just use the path the main datasource like below, nothing is returned.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;xdXDocument:GetDOM(&amp;quot;connection 1&amp;quot;)/dfs:myFields/dfs:dataFields/dfs:myRecord[@ID = /my:myFields/my:mainID]/@Title&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;quot;/my:myFields/my:mainID&amp;quot; is the xpath to the field acting as my &amp;quot;where&amp;quot; clause.&amp;nbsp; If I use that path by itself in another &amp;quot;set value&amp;quot; rule it does return a value.&amp;nbsp; I just can&amp;#39;t get it to work in combination with the GetDom attempt above.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Right now I&amp;#39;m using a work-around in code-behind, but it&amp;#39;s a good academic exercise to know if this can be done.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;</description></item><item><title>Re: Xpath statement referencing 2 different data sources</title><link>https://www.infopathdev.com:443/forums/thread/35389.aspx</link><pubDate>Sat, 06 Dec 2008 02:52:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:35389</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/35389.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=35389</wfw:commentRss><description>&lt;p&gt;Generally you should be able to accomplish it with something like this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;xdXDocument:GetDOM(&amp;quot;Data connection 1&amp;quot;)/dfs:myFields/dfs:dataFields/dfs:myRecord[@ID = &lt;strong&gt;xdXDocument:GetDOM(&amp;quot;Data connection 2&amp;quot;)/&lt;em&gt;path/to/other/field&lt;/em&gt;&lt;/strong&gt;]/@Title&lt;/p&gt;&lt;/blockquote&gt;</description></item><item><title>Xpath statement referencing 2 different data sources</title><link>https://www.infopathdev.com:443/forums/thread/35388.aspx</link><pubDate>Sat, 06 Dec 2008 01:29:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:35388</guid><dc:creator>Greg S</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/35388.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=35388</wfw:commentRss><description>&lt;p&gt;Without doing code behind (i.e. just using standard InfoPath rules), is it possible to set a field&amp;#39;s value based on an Xpath expression where that Xpath expression contains a reference to another field?&amp;nbsp; &lt;/p&gt;
&lt;p&gt;For example this xpath statement works for setting a field&amp;#39;s value in a rule, but the &amp;quot;where&amp;quot; clause is hard-coded to 123:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;xdXDocument:GetDOM(&amp;quot;Data connection 1&amp;quot;)/dfs:myFields/dfs:dataFields/dfs:myRecord[@ID = &amp;quot;&lt;strong&gt;123&lt;/strong&gt;&amp;quot;]/@Title&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;This obtains the correct @Title value for the record where the @ID attribute is &amp;quot;123&amp;quot;, but I need to replace &amp;quot;123&amp;quot; with some value in another field on the form that is bound to a different data source.&lt;/p&gt;
&lt;p&gt;Is this possible without doing code behind and doing multiple queries against the different data sources?&lt;/p&gt;</description></item></channel></rss>