<?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: Setting non-text values using selectSingleNode</title><link>https://www.infopathdev.com:443/forums/thread/82464.aspx</link><pubDate>Mon, 10 Sep 2012 00:49:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:82464</guid><dc:creator>sudlev</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/82464.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=82464</wfw:commentRss><description>&lt;p&gt;...and also the cs project. It would only allow me to attach one file.&lt;/p&gt;</description></item><item><title>Re: Setting non-text values using selectSingleNode</title><link>https://www.infopathdev.com:443/forums/thread/82463.aspx</link><pubDate>Mon, 10 Sep 2012 00:48:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:82463</guid><dc:creator>sudlev</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/82463.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=82463</wfw:commentRss><description>&lt;p&gt;No worries Gennady Vanin.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve attached the form.&lt;/p&gt;</description></item><item><title>Re: Setting non-text values using selectSingleNode</title><link>https://www.infopathdev.com:443/forums/thread/82426.aspx</link><pubDate>Fri, 07 Sep 2012 14:23:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:82426</guid><dc:creator>Gennady Vanin (Геннадий Ванин, Новосибирск)</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/82426.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=82426</wfw:commentRss><description>&lt;p&gt;Since you already had trouble with it and ready template with code, could you modify it to create a demo (XSN template+VSTA project) archive (e.g. .zip file) and post it to help others to walk through the discussed issues?&amp;nbsp; &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Setting non-text values using selectSingleNode</title><link>https://www.infopathdev.com:443/forums/thread/82415.aspx</link><pubDate>Fri, 07 Sep 2012 01:02:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:82415</guid><dc:creator>sudlev</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/82415.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=82415</wfw:commentRss><description>&lt;p&gt;Yes, I can understand. Thankfully someone else went through all the pain so I didn&amp;#39;t have to...&lt;/p&gt;
&lt;p&gt;You&amp;#39;d think they&amp;#39;d have some kind of guide out there on how to do all this stuff. I mean something as simple as setting a field value programmatically really shouldn&amp;#39;t be so painful. &lt;/p&gt;</description></item><item><title>Re: Setting non-text values using selectSingleNode</title><link>https://www.infopathdev.com:443/forums/thread/82414.aspx</link><pubDate>Fri, 07 Sep 2012 00:48:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:82414</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/82414.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=82414</wfw:commentRss><description>&lt;p&gt;Oh, happy to help - that one made me CRY, I swear. I was so glad when I finally found out that I was not actually crazy - that the validation actually works &lt;em&gt;differently &lt;/em&gt;in browser vs. filler.&lt;/p&gt;</description></item><item><title>Re: Setting non-text values using selectSingleNode</title><link>https://www.infopathdev.com:443/forums/thread/82413.aspx</link><pubDate>Fri, 07 Sep 2012 00:36:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:82413</guid><dc:creator>sudlev</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/82413.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=82413</wfw:commentRss><description>&lt;p&gt;This works beautifully!&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t thank you enough Hilary, you&amp;#39;ve been a MASSIVE help!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Danny&lt;/p&gt;</description></item><item><title>Re: Setting non-text values using selectSingleNode</title><link>https://www.infopathdev.com:443/forums/thread/82375.aspx</link><pubDate>Thu, 06 Sep 2012 15:06:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:82375</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/82375.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=82375</wfw:commentRss><description>&lt;p&gt;You aren&amp;#39;t a pest.&lt;/p&gt;
&lt;p&gt;It turns out this works differently in the browser - I had an email conversation with the InfoPath team at MS about this a couple of years ago, and was told:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* ...there are differences in the way MSXML (InfoPath client XML library) and System.Xml (IPFS XML library) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * are validating the XML against the schema. After executing the SetValue() method, System.Xml &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * recognizes the empty text node as a child of the “my:file” node. As such, a validation error &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * occurs when you attempt to reapply the ‘nil’ attribute.*/&lt;/p&gt;
&lt;p&gt;So, I did this instead:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Because of this, modifying from &amp;#39;SetValue&amp;#39; to &amp;#39;DeleteSelf&amp;#39;. MS dev states the following works in client and browser.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // For details on the below 2 lines, refer to:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // &lt;a href="http://msdn.microsoft.com/en-us/library/system.xml.xpath.xpathnavigator.deleteself.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.xml.xpath.xpathnavigator.deleteself.aspx&lt;/a&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fileNode.MoveToFirstChild(); // This moves to the text value of the node.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fileNode.DeleteSelf(); // This deletes the text value. On delete, node reverts to the parent.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Not sure what data type is, so if this fails, it is probably string, so ignore.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fileNode.CreateAttribute(&amp;quot;xsi&amp;quot;, &amp;quot;nil&amp;quot;, &amp;quot;&lt;a href="http://www.w3.org/2001/XMLSchema-instance"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/a&gt;&amp;quot;, &amp;quot;true&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;</description></item><item><title>Re: Setting non-text values using selectSingleNode</title><link>https://www.infopathdev.com:443/forums/thread/82355.aspx</link><pubDate>Thu, 06 Sep 2012 14:06:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:82355</guid><dc:creator>Gennady Vanin (Геннадий Ванин, Новосибирск)</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/82355.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=82355</wfw:commentRss><description>&lt;p&gt;&lt;a href="http://office.microsoft.com/en-us/infopath-help/infopath-2010-features-unavailable-in-web-browser-forms-HA101732796.aspx#_Toc270512423" title="InfoPath 2010 features unavailable in Web browser forms"&gt;&amp;nbsp;InfoPath 2010 features unavailable in Web browser forms (comparative compatibility matrix)&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Re: Setting non-text values using selectSingleNode</title><link>https://www.infopathdev.com:443/forums/thread/82346.aspx</link><pubDate>Thu, 06 Sep 2012 05:15:43 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:82346</guid><dc:creator>sudlev</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/82346.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=82346</wfw:commentRss><description>&lt;p&gt;Hi again guys, &lt;/p&gt;
&lt;p&gt;My code (above) was working beautifully in preview mode in the designer, but now that it&amp;#39;s been published it is failing again. Is there a reason this would not work in a browser form?&lt;/p&gt;
&lt;p&gt;Sorry to be a pest.&lt;/p&gt;
&lt;p&gt;Danny&lt;/p&gt;</description></item><item><title>Re: Setting non-text values using selectSingleNode</title><link>https://www.infopathdev.com:443/forums/thread/82310.aspx</link><pubDate>Wed, 05 Sep 2012 04:19:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:82310</guid><dc:creator>sudlev</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/82310.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=82310</wfw:commentRss><description>&lt;p&gt;You were correct, in order to clear the value of the field I needed to add the xsl:nil attribute to the element. As you described in the &lt;a href="http://www.infopathdev.com/forums/p/15431/54713.aspx"&gt;how to add xsi:nil = &amp;quot;true&amp;quot;&lt;/a&gt; thread. I&amp;#39;ve pasted my code below for reference.&lt;br /&gt;_____________&lt;/p&gt;&lt;font size="2"&gt;valueNode.SetValue(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Empty);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (!valueNode.MoveToAttribute(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;nil&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;))&lt;/p&gt;
&lt;p&gt;valueNode.CreateAttribute(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;xsi&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;nil&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, System.Xml.Schema.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;XmlSchema&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.InstanceNamespace, &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;true&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;//required attribute for non-string values&lt;br /&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;Thanks for your help!&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;</description></item><item><title>Re: Setting non-text values using selectSingleNode</title><link>https://www.infopathdev.com:443/forums/thread/82273.aspx</link><pubDate>Tue, 04 Sep 2012 11:26:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:82273</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/82273.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=82273</wfw:commentRss><description>The problem here is most likely the presence of an xsi:nil attribute.&amp;nbsp; Search this forum for xsi:nil, and you should find plenty of help.</description></item><item><title>Re: Setting non-text values using selectSingleNode</title><link>https://www.infopathdev.com:443/forums/thread/82268.aspx</link><pubDate>Tue, 04 Sep 2012 05:27:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:82268</guid><dc:creator>sudlev</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/82268.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=82268</wfw:commentRss><description>&lt;p&gt;Hi Greg, &lt;/p&gt;
&lt;p&gt;Can you assist me with this? I am unable to get my code to work (and I am not a programmer so I&amp;#39;ve really struggled with this).&lt;/p&gt;
&lt;p&gt;What I want to do is set an int field to null or equivalent. I tried using &lt;font size="2"&gt;ValueNode.SetValue(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;) but that gived me invalid data.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font size="2"&gt;I really appreciate any assistance you can offer.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Danny&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: Setting non-text values using selectSingleNode</title><link>https://www.infopathdev.com:443/forums/thread/66068.aspx</link><pubDate>Wed, 20 Apr 2011 15:05:23 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:66068</guid><dc:creator>pamam</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/66068.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=66068</wfw:commentRss><description>&lt;p&gt;Thanks for the help,&lt;/p&gt;
&lt;p&gt;Mel&lt;/p&gt;</description></item><item><title>Re: Setting non-text values using selectSingleNode</title><link>https://www.infopathdev.com:443/forums/thread/66033.aspx</link><pubDate>Tue, 19 Apr 2011 22:40:23 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:66033</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/66033.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=66033</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;To remove the nil attribute (required before setting a value to a field with the nil attribute), you select the attribute the same way you would select any node, and then delete it. Then you can set the value.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Setting non-text values using selectSingleNode</title><link>https://www.infopathdev.com:443/forums/thread/65692.aspx</link><pubDate>Fri, 01 Apr 2011 19:49:23 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65692</guid><dc:creator>pamam</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65692.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=65692</wfw:commentRss><description>&lt;p&gt;How do you remove an attribute programmatically&lt;/p&gt;</description></item></channel></rss>