<?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: Error when changing field value with selectSingleNode</title><link>https://www.infopathdev.com:443/forums/thread/26940.aspx</link><pubDate>Mon, 03 Mar 2008 18:41:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:26940</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/26940.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=26940</wfw:commentRss><description>&lt;p&gt;That&amp;#39;s the way it is with computers!&lt;/p&gt;
&lt;p&gt;It can sometimes be like the new &amp;quot;computer mom&amp;quot; who discovers &amp;quot;format c:&amp;quot; :o)&lt;/p&gt;</description></item><item><title>Re: Error when changing field value with selectSingleNode</title><link>https://www.infopathdev.com:443/forums/thread/26899.aspx</link><pubDate>Fri, 29 Feb 2008 19:53:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:26899</guid><dc:creator>KoopLaFez</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/26899.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=26899</wfw:commentRss><description>&lt;p&gt;It worked!&amp;nbsp; Thanks Greg.&amp;nbsp; I&amp;#39;m learning&amp;nbsp; this as&amp;nbsp;I go, and it seem&amp;nbsp;like the more I learn the more dangerous I get.&lt;/p&gt;</description></item><item><title>Re: Error when changing field value with selectSingleNode</title><link>https://www.infopathdev.com:443/forums/thread/26894.aspx</link><pubDate>Fri, 29 Feb 2008 17:26:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:26894</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/26894.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=26894</wfw:commentRss><description>&lt;p&gt;Most likely the two forms have different namespace definitions for the &amp;quot;my&amp;quot; prefix. In your test form you have:&lt;/p&gt;
&lt;p&gt;xmlns:my=&amp;quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2008-01-22T18:18:32&amp;quot;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But in your production form, the date-time stamp on the end is likely different. The definition needs to match exactly what the form template says it should be. To find out, extract your form files and open the manifest.xsf or template.xml file in notepad and copy the valid definition for the &amp;quot;my&amp;quot; prefix. Then use the correct one in the code.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Error when changing field value with selectSingleNode</title><link>https://www.infopathdev.com:443/forums/thread/26865.aspx</link><pubDate>Thu, 28 Feb 2008 23:36:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:26865</guid><dc:creator>KoopLaFez</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/26865.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=26865</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m trying to change the value of a field using the selectSingleNode method.&amp;nbsp; I have a test form that I use to test and debug new code before I use it on my production form.&amp;nbsp; In the Test form, I used the following code to change the value of the &amp;quot;Test&amp;quot; field to &amp;quot;123&amp;quot;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;XDocument.DOM.selectSingleNode(&amp;quot;my:myFields/my:Test&amp;quot;).text = &amp;quot;123&amp;quot;;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;This worked fine, but when I moved into my production form, I got the following error:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Reference to undeclared namespace prefix: &amp;#39;my&amp;#39;.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I looked back through my code and I realized tha the namespace definition that was in my test form was not in my production form, so I added the following line of code at the top of the Script.js:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;XDocument.DOM.setProperty(&amp;quot;SelectionNamespaces&amp;quot;, &amp;#39;xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot; xmlns:my=&amp;quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2008-01-22T18:18:32&amp;quot; xmlns:xd=&amp;quot;http://schemas.microsoft.com/office/infopath/2003&amp;quot;&amp;#39;);&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The next time I ran the code, I got the following error:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;#39;XDocument.DOM.selectSingleNode(...)&amp;#39; is null or not an object&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;I don&amp;#39;t know what to do at this point.&amp;nbsp; Any ideas?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>