<?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>Data Connections</title><link>https://www.infopathdev.com:443/forums/44.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Xml Namespace problem when using Submit To Hosting Environment</title><link>https://www.infopathdev.com:443/forums/thread/48063.aspx</link><pubDate>Tue, 20 Oct 2009 20:30:02 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:48063</guid><dc:creator>zartr</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/48063.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=44&amp;PostID=48063</wfw:commentRss><description>&lt;p&gt;Correct. That is if you were using that inside a form&amp;#39;s code behind file.&lt;br /&gt;Obviously &amp;quot;this.NamespaceManager&amp;quot; won&amp;#39;t be available once you&amp;#39;re confronted with the xml output and the xml output only in some other application/environment/solar system for that matter.&lt;/p&gt;&lt;p&gt;If I remember correctly I solved the problem by loading the whole xml data into an XmlDocument and reading the top node&amp;#39;s namespace(s). I consider it more as a work around than a viable option but it works nonetheless.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Xml Namespace problem when using Submit To Hosting Environment</title><link>https://www.infopathdev.com:443/forums/thread/48053.aspx</link><pubDate>Tue, 20 Oct 2009 16:48:40 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:48053</guid><dc:creator>arichterwork</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/48053.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=44&amp;PostID=48053</wfw:commentRss><description>&lt;p&gt;Whenever I have to select a node within code, from either the main data source or a secondary data source, I use the following:&lt;/p&gt;
&lt;p&gt;From Main Data Source:&lt;/p&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;
&lt;p&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; nav = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.MainDataSource.CreateNavigator();&lt;br /&gt;&lt;font color="#2b91af"&gt;XPathNavigator&lt;/font&gt;&lt;font size="2"&gt; node =&amp;nbsp;&lt;/font&gt;nav.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/my:myFields/my:field1&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.NamespaceManager);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;From Secondary Data Source:&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;
&lt;p&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; nav = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.DataSources[&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;DataSourceName&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;].CreateNavigator();&lt;br /&gt;&lt;font color="#2b91af"&gt;XPathNavigator&lt;/font&gt;&lt;font size="2"&gt; node = &lt;/font&gt;nav.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;[insert xpath query here]&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.NamespaceManager);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;--andrew&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;</description></item><item><title>Re: Xml Namespace problem when using Submit To Hosting Environment</title><link>https://www.infopathdev.com:443/forums/thread/43811.aspx</link><pubDate>Mon, 06 Jul 2009 16:09:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:43811</guid><dc:creator>zartr</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/43811.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=44&amp;PostID=43811</wfw:commentRss><description>&lt;p&gt;I created a small workaround to read the proper uri for the &amp;quot;my&amp;quot; namespace first.&lt;br /&gt;Still I&amp;#39;m wondering if that&amp;#39;s the way to go here.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Xml Namespace problem when using Submit To Hosting Environment</title><link>https://www.infopathdev.com:443/forums/thread/43790.aspx</link><pubDate>Sun, 05 Jul 2009 19:39:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:43790</guid><dc:creator>zartr</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/43790.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=44&amp;PostID=43790</wfw:commentRss><description>&lt;p&gt;hello everyone,&lt;/p&gt;&lt;p&gt;I&amp;#39;m unable to select a single node within my xml document :-/&lt;br /&gt;http://msdn.microsoft.com/en-us/library/aa701078.aspx&lt;/p&gt;&lt;pre class="libCScode" style="white-space:pre-wrap;" id="ctl00_MTContentSelector1_mainContentContainer_ctl34CSharp"&gt;&lt;span style="color:blue;"&gt;protected&lt;/span&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; XmlFormView1_Initialize(object sender, &lt;br /&gt;   InitializeEventArgs e)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color:green;"&gt;// Create an XPathNavigator positioned at the root of &lt;/span&gt;&lt;span style="color:green;"&gt;the form&amp;#39;s main data source.&lt;/span&gt;&lt;br /&gt;    XPathNavigator xNavMain = XmlFormView1.XmlForm.MainDataSource.CreateNavigator();&lt;br /&gt;    &lt;span style="color:green;"&gt;// Create an XmlNamespaceManager and add the &amp;quot;my&amp;quot; namespace&lt;/span&gt; &lt;span style="color:green;"&gt;alias from the form&amp;#39;s main data source.&lt;/span&gt;&lt;br /&gt;    XmlNamespaceManager xNameSpace = &lt;span style="color:blue;"&gt;new&lt;/span&gt; XmlNamespaceManager(&lt;span style="color:blue;"&gt;new&lt;/span&gt; NameTable());&lt;br /&gt;    xNameSpace.AddNamespace(&lt;span style="color:maroon;"&gt;&lt;span style="color:maroon;"&gt;&amp;quot;my&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span style="color:maroon;"&gt;&lt;span style="color:maroon;"&gt;&amp;quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-04-20T16:26:21&amp;quot;&lt;/span&gt;&lt;/span&gt;);&lt;br /&gt;    &lt;span style="color:green;"&gt;// Create an XPathNavigator positioned on the form&amp;#39;s field2.&lt;/span&gt;&lt;br /&gt;    XPathNavigator fTextBox1 = xNavMain.SelectSingleNode(&lt;span style="color:maroon;"&gt;&lt;span style="color:maroon;"&gt;&amp;quot;my:myFields/my:field2&amp;quot;&lt;/span&gt;&lt;/span&gt;, xNameSpace);&lt;br /&gt;    &lt;span style="color:green;"&gt;// Set the form&amp;#39;s field2 to the value in TextBox1.&lt;/span&gt;&lt;br /&gt;    fTextBox1.SetValue(TextBox1.Text);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;First of all... my uri for the &amp;quot;my&amp;quot; namespace is different as Infopath seems to create a new uri for each xml document.&lt;br /&gt;I therefore tried to use xNavMain.LookupNamespace(&amp;quot;my&amp;quot;)... but that doesn&amp;#39;t return much (null).&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="libCScode" style="white-space:pre-wrap;" id="ctl00_MTContentSelector1_mainContentContainer_ctl34CSharp"&gt;xNavMain.SelectSingleNode(&amp;quot;/myFields/my:forename&amp;quot;, xNameSpace); always returns null.&lt;/pre&gt;&lt;pre class="libCScode" style="white-space:pre-wrap;" id="ctl00_MTContentSelector1_mainContentContainer_ctl34CSharp"&gt;The XML as returned by XPathNavigator xNavMain = XmlFormView1.XmlForm.MainDataSource.CreateNavigator();&lt;br /&gt; &lt;br /&gt;&amp;lt;?mso-infoPathSolution name=&amp;quot;urn:schemas-microsoft-com:office:infopath:MyEmptyTemplateFour:-myXSD-2009-07-05T16-25-14&amp;quot; solutionVersion=&amp;quot;1.0.0.13&amp;quot; productVersion=&amp;quot;12.0.0.0&amp;quot; PIVersion=&amp;quot;1.0.0.0&amp;quot; href=&amp;quot;http://portal.litwareinc.com/MyPublishingSite/MyFormsLibrary/MyTestForms/MyEmptyTemplateFour.xsn&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;?mso-application progid=&amp;quot;InfoPath.Document&amp;quot; versionProgid=&amp;quot;InfoPath.Document.2&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;my:myFields xml:lang=&amp;quot;en-US&amp;quot;&lt;br /&gt;             xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&lt;br /&gt;             xmlns:xhtml=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;br /&gt;             xmlns:my=&amp;quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2009-07-05T16:25:14&amp;quot;&lt;br /&gt;             xmlns:xd=&amp;quot;http://schemas.microsoft.com/office/infopath/2003&amp;quot;&amp;gt;&lt;br /&gt;  &amp;lt;my:CbAllowSubmit&amp;gt;true&amp;lt;/my:CbAllowSubmit&amp;gt;&lt;br /&gt;  &amp;lt;my:forename&amp;gt;&amp;lt;/my:forename&amp;gt;&lt;br /&gt;  &amp;lt;my:lastname&amp;gt;&amp;lt;/my:lastname&amp;gt;&lt;br /&gt;&amp;lt;/my:myFields&amp;gt;&lt;br /&gt; &lt;/pre&gt;&lt;pre class="libCScode" style="white-space:pre-wrap;" id="ctl00_MTContentSelector1_mainContentContainer_ctl34CSharp"&gt;It looks okay, right? &lt;br /&gt;&lt;/pre&gt;</description></item></channel></rss>