<?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: Loading secondary datasource into form</title><link>https://www.infopathdev.com:443/forums/thread/21317.aspx</link><pubDate>Wed, 27 Jun 2007 21:37:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21317</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21317.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=21317</wfw:commentRss><description>Cool, glad you got everything figured out! Let us know if you need anything else.</description></item><item><title>Re: Loading secondary datasource into form</title><link>https://www.infopathdev.com:443/forums/thread/21309.aspx</link><pubDate>Wed, 27 Jun 2007 16:30:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21309</guid><dc:creator>spudy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21309.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=21309</wfw:commentRss><description>&lt;p&gt;Found the problem to be another group beneath Group2 in the main data source. Once deleted or moved to higher in the tree above Group 2 then this cured the problem.&lt;/p&gt;&lt;p&gt;thanks for your assistance again Matt.&lt;/p&gt;</description></item><item><title>Re: Loading secondary datasource into form</title><link>https://www.infopathdev.com:443/forums/thread/21266.aspx</link><pubDate>Tue, 26 Jun 2007 18:22:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21266</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21266.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=21266</wfw:commentRss><description>Weird.&amp;nbsp; This should be a pretty simple mistake, the schemas are not matching up for some reason, but I cannot figure out why from what you have shown me.&amp;nbsp; I would suggest outputting the .xml of the various objects and see what you can deduce.</description></item><item><title>Re: Loading secondary datasource into form</title><link>https://www.infopathdev.com:443/forums/thread/21262.aspx</link><pubDate>Tue, 26 Jun 2007 15:54:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21262</guid><dc:creator>spudy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21262.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=21262</wfw:commentRss><description>&lt;p&gt;Matt,&lt;/p&gt;&lt;p&gt;Thanks for the response. I tried that but the same error is displayed with the exception that the parent element changes to reflect the change you mentioned. Your good luck message owing the to meticulousness of this code does cause concern for me. Pethaps there is an easier way of doing this?&lt;/p&gt;&lt;p&gt;thanks&lt;/p&gt;</description></item><item><title>Re: Loading secondary datasource into form</title><link>https://www.infopathdev.com:443/forums/thread/21252.aspx</link><pubDate>Tue, 26 Jun 2007 14:19:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21252</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21252.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=21252</wfw:commentRss><description>&lt;p&gt;You&amp;#39;re trying to add it in the wrong place, change the line to this:&lt;/p&gt;&lt;p&gt;// Add the row to the table (where the code fails)&lt;br /&gt;XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:group1&amp;quot;).appendChild(oNewRow);&lt;/p&gt;&lt;p&gt;Good luck on this, though! It is quite meticulous.&lt;/p&gt;</description></item><item><title>Loading secondary datasource into form</title><link>https://www.infopathdev.com:443/forums/thread/21238.aspx</link><pubDate>Tue, 26 Jun 2007 08:49:21 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21238</guid><dc:creator>spudy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21238.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=21238</wfw:commentRss><description>&lt;p&gt;I have been using a post by Matt &lt;a href="http://www.infopathdev.com/blogs/matt/archive/2005/11/29/Repeat-Table-Headers-Across-Multiple-Printed-Pages.aspx"&gt;http://www.infopathdev.com/blogs/matt/archive/2005/11/29/Repeat-Table-Headers-Across-Multiple-Printed-Pages.aspx&lt;/a&gt;&amp;nbsp;for some of the code I have used to copy all nodes from a secondary datasource into a form. &lt;/p&gt;&lt;p&gt;The code is as follows:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var domDataLibrary = XDocument.GetDOM(&amp;quot;Data Library&amp;quot;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Source nodes.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var oDataItems = domDataLibrary.selectNodes(&amp;quot;/ds1:Schedule/ds1:List/ds1:Item&amp;quot;);&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Get the node list.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var oRows = XDocument.DOM.selectNodes(&amp;quot;/my:myFields/my:group1/my:group2&amp;quot;);&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Save a sample node from this list&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var oSampleRow = oRows.nextNode();&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Loop through all source nodes.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(oSrc = oDataItems.nextNode())&lt;br /&gt;&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; var oNewRow = oSampleRow.cloneNode(true);&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oNewRow.selectSingleNode(&amp;quot;my:field2&amp;quot;).nodeTypedValue = oSrc.selectSingleNode(&amp;quot;ds1:Code&amp;quot;).nodeTypedValue;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oNewRow.selectSingleNode(&amp;quot;my:field3&amp;quot;).nodeTypedValue = oSrc.selectSingleNode(&amp;quot;ds1:Description&amp;quot;).nodeTypedValue;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oNewRow.selectSingleNode(&amp;quot;my:field4&amp;quot;).nodeTypedValue = oSrc.selectSingleNode(&amp;quot;ds1:Unit&amp;quot;).nodeTypedValue;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oNewRow.selectSingleNode(&amp;quot;my:field5&amp;quot;).nodeTypedValue = oSrc.selectSingleNode(&amp;quot;ds1:Price&amp;quot;).nodeTypedValue;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Add the row to the table (where the code fails)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:group1/my:group2&amp;quot;).appendChild(oNewRow);&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } }&lt;/p&gt;&lt;p&gt;&amp;nbsp;The code fails with the following error:&lt;/p&gt;&lt;p&gt;The following error occurred:&lt;/p&gt;&lt;p&gt;Element &amp;#39;{http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-06-19T14:57:44}group2&amp;#39; is unexpected according to content model of parent element &amp;#39;{http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-06-19T14:57:44}group2&amp;#39;.&lt;/p&gt;&lt;p&gt;File:script.js&lt;br /&gt;Line:121&lt;/p&gt;&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;Any help on this one would be great.....something simple no doubt ...&lt;/font&gt;&lt;/p&gt;</description></item></channel></rss>