<?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>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Copying secondary datasource to main datasource</title><link>https://www.infopathdev.com:443/forums/thread/57580.aspx</link><pubDate>Tue, 03 Aug 2010 14:18:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57580</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57580.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=57580</wfw:commentRss><description>&lt;p&gt;Excellent!&amp;nbsp; Glad to hear you figured it out.&lt;/p&gt;</description></item><item><title>Re: Copying secondary datasource to main datasource</title><link>https://www.infopathdev.com:443/forums/thread/57564.aspx</link><pubDate>Tue, 03 Aug 2010 11:16:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57564</guid><dc:creator>Graeme</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57564.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=57564</wfw:commentRss><description>&lt;p&gt;OK, I did some homework. Now I realise xsi:nil means the element MUST be empty. So I&amp;#39;ve added some xslt and my code works fine now.&amp;nbsp; Here is the xslt - it adds the &amp;quot;my&amp;quot; namespace and adds xsi:nil to my two date fields if they are blank.&lt;/p&gt;
&lt;p&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;String&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; xsltString = &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;@&amp;quot;&amp;lt;xsl:stylesheet xmlns:xsl=&amp;#39;http://www.w3.org/1999/XSL/Transform&amp;#39; version=&amp;#39;1.0&amp;#39;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;lt;xsl:template match=&amp;#39;*&amp;#39;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt; 
&lt;p&gt;&amp;nbsp; &amp;lt;xsl:element name=&amp;#39;my:{local-name()}&amp;#39; xmlns:xsi=&amp;#39;http://www.w3.org/2001/XMLSchema-instance&amp;#39; xmlns:my=&amp;#39;http://schemas.microsoft.com/office/infopath/2003/myXSD/2010-07-28T07:33:11&amp;#39; &amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:if test=&amp;#39;(local-name()=&amp;quot;&amp;quot;DateTo&amp;quot;&amp;quot; or local-name()=&amp;quot;&amp;quot;DateFrom&amp;quot;&amp;quot;) and .=&amp;quot;&amp;quot;&amp;quot;&amp;quot;&amp;#39;&amp;gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:attribute name=&amp;#39;xsi:nil&amp;#39;&amp;gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:value-of select=&amp;#39;true()&amp;#39;/&amp;gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xsl:attribute&amp;gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xsl:if&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;lt;xsl:apply-templates /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/xsl:element&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/xsl:template&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/xsl:stylesheet&amp;gt;&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: Copying secondary datasource to main datasource</title><link>https://www.infopathdev.com:443/forums/thread/57559.aspx</link><pubDate>Tue, 03 Aug 2010 10:00:18 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57559</guid><dc:creator>Graeme</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57559.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=57559</wfw:commentRss><description>&lt;p&gt;See attached. I&amp;#39;m using some xslt code that I found in one of your forums. The code that adds the nil attribute only adds it to the first Meeting record.&lt;/p&gt;
&lt;p&gt;BTW, what does xsi:nil actually do? Is it simply telling Infopath that null values are allowed? Or that the value must be null?&lt;/p&gt;</description></item><item><title>Re: Copying secondary datasource to main datasource</title><link>https://www.infopathdev.com:443/forums/thread/57557.aspx</link><pubDate>Tue, 03 Aug 2010 09:34:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57557</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57557.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=57557</wfw:commentRss><description>&lt;p&gt;Could you post the code you&amp;#39;re using to copy the data over?&lt;/p&gt;</description></item><item><title>Re: Copying secondary datasource to main datasource</title><link>https://www.infopathdev.com:443/forums/thread/57554.aspx</link><pubDate>Tue, 03 Aug 2010 07:18:40 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57554</guid><dc:creator>Graeme</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57554.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=57554</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m still struggling with this and would appreciate any help. Thanks.&lt;/p&gt;</description></item><item><title>Re: Copying secondary datasource to main datasource</title><link>https://www.infopathdev.com:443/forums/thread/57527.aspx</link><pubDate>Mon, 02 Aug 2010 12:55:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57527</guid><dc:creator>Graeme</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57527.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=57527</wfw:commentRss><description>&lt;p&gt;OK, I found some example of yours in the forum and added this code just after copying the datasource to Main:&lt;/p&gt;
&lt;p&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; dateNode = xNavMainDataSource.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/my:myFields/my:Meetings/my:Meeting/my:DateTo&amp;quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; dateNode.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;, NamespaceManager.LookupNamespace(&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;true&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;But that only adds the attribute to the first record in my repeating group. How do I add it to all records (Meetings)?&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;UPDATE:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;I also notice &lt;a href="http://www.infopathdev.com/forums/p/15431/54705.aspx"&gt;in this post&lt;/a&gt; that you said the node must be blank before adding the nil&amp;nbsp;attribute. That will defeat my whole purpose of copying the values from a 2nd data source. Is there a way around this?&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: Copying secondary datasource to main datasource</title><link>https://www.infopathdev.com:443/forums/thread/57524.aspx</link><pubDate>Mon, 02 Aug 2010 12:12:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57524</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57524.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=57524</wfw:commentRss><description>&lt;p&gt;Most likely you will need to add code to add an &lt;strong&gt;xsi:nil=&amp;quot;true&amp;quot;&lt;/strong&gt; attribute to your my:DateTo nodes if they are blank.&lt;/p&gt;</description></item><item><title>Copying secondary datasource to main datasource</title><link>https://www.infopathdev.com:443/forums/thread/57522.aspx</link><pubDate>Mon, 02 Aug 2010 11:42:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57522</guid><dc:creator>Graeme</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57522.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=57522</wfw:commentRss><description>&lt;p&gt;On form load I am copying a nodeset from a 2ndary source into the main source.&amp;nbsp;&amp;nbsp;It all works fine except&amp;nbsp;with a dateTime field that is blank, then I get a validation error&amp;nbsp;&amp;quot;only date and time allowed&amp;quot;.&amp;nbsp; Neither of the data sources fields are set to &amp;quot;Cannot be blank&amp;quot;.&amp;nbsp; When I save the xml and view it, the field is&amp;nbsp;an empty element: &lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;my:DateTo&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;/&amp;gt;. &lt;font color="#000000"&gt;I don&amp;#39;t see what is wrong with this.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#000000"&gt;Any idea what I can do to get this working?&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;I am actually not even usign this field in the main data source but it seems that in order to do the copy, the schema must match the 2ndary source exactly wlse I get the error &amp;quot;Schema validation found non-data type errors&amp;quot;&lt;/p&gt;</description></item></channel></rss>