<?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: XPATH conditional in C#</title><link>https://www.infopathdev.com:443/forums/thread/28518.aspx</link><pubDate>Mon, 05 May 2008 22:45:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:28518</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/28518.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=28518</wfw:commentRss><description>&lt;p&gt;You can certainly use an XPath like:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;my:field1 = &amp;#39;Include&amp;#39;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;my:field1[. = &amp;#39;Include&amp;#39;]&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;But you cannot use:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;count(my:RepGroup1)&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;because this is not supported in code. However, you can do a selectNodes and then get the .Count property for the number you want.&lt;/p&gt;</description></item><item><title>XPATH conditional in C#</title><link>https://www.infopathdev.com:443/forums/thread/28458.aspx</link><pubDate>Thu, 01 May 2008 15:42:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:28458</guid><dc:creator>djay</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/28458.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=28458</wfw:commentRss><description>&lt;p&gt;Is there a way to run an XPATH query directly from managed code?&lt;/p&gt;
&lt;p&gt;So I want to be able to run &amp;quot;count(my:RepGroup1)&amp;quot; and return a number.&amp;nbsp; Or &amp;quot;my:field1 = &amp;#39;Include&amp;#39;&amp;quot; and get a bool back.&lt;/p&gt;
&lt;p&gt;I know I can do any of this using the API, but I want to use XPATH specifically.&amp;nbsp; I am pulling an XPATH conditional from an SQL database and I want to perform an action only if the XPATH evals to true.&amp;nbsp; Right now I have a hacky implementation that uses selectNodes with a filter which returns null when the XPATH is false.&amp;nbsp; But I am hoping their is a cleaner implementation.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;BTW - I am on the 2003 API&amp;#39;s.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Dan&lt;/p&gt;</description></item></channel></rss>