<?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: SelectSingleNode not working?</title><link>https://www.infopathdev.com:443/forums/thread/55576.aspx</link><pubDate>Thu, 03 Jun 2010 15:21:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:55576</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/55576.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=55576</wfw:commentRss><description>&lt;p&gt;To get the XPath for your SelectSingleNode, right click the node and select &amp;quot;Copy XPath&amp;quot;. Then paste that in your quotes (though what you have in your post does look correct). Perhaps before getting the value, create another XPathNavigator variable for the node itself, so you can see if that returns null?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;XPathNavigator surnameNode = xnDoc.SelectSingleNode(&amp;quot;/my:myFields/my:Policyholder_Surname&amp;quot;, ns);&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Make sure that this node is included in your form by default -- that would be under Tools / Default Values. If the&amp;nbsp;node isn&amp;#39;t included by default, it won&amp;#39;t be there to select....&amp;nbsp;&lt;/p&gt;</description></item><item><title>SelectSingleNode not working?</title><link>https://www.infopathdev.com:443/forums/thread/55572.aspx</link><pubDate>Thu, 03 Jun 2010 15:14:23 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:55572</guid><dc:creator>tehprince</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/55572.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=55572</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m trying to select the value from a textbox but it keeps returning NULL, I can&amp;#39;t for the life of me figure out why.&amp;nbsp; Here&amp;#39;s some info:&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;img src="http://api.photoshop.com/home_26ebb7aa51c44c3db1bf80fa5c347c32/adobe-px-assets/d6d80876b51c4d1fb255d299fa84d65b" height="436" width="552" alt="" /&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;img src="http://api.photoshop.com/home_26ebb7aa51c44c3db1bf80fa5c347c32/adobe-px-assets/f0365d2bbc61486390af41e027688c40" height="261" width="187" alt="" /&gt;
&lt;p&gt;My code:&lt;/p&gt;
&lt;p&gt;XmlNamespaceManager ns = this.NamespaceManager;&lt;br /&gt;XPathNavigator xnDoc = this.MainDataSource.CreateNavigator();&lt;br /&gt;string surname = xnDoc.SelectSingleNode(&amp;quot;/my:myFields/my:Policyholder_Surname&amp;quot;, ns).Value.ToString(); &lt;/p&gt;&lt;p&gt;I&amp;#39;ve also tried //my:myFields/my:Policyholder_Surname and //my:Policyholder_Surname &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Any help would be most appreciated! &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>