<?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: Subset of Nodes from Nodelist by Index range</title><link>https://www.infopathdev.com:443/forums/thread/24879.aspx</link><pubDate>Tue, 04 Dec 2007 06:44:02 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:24879</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/24879.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=24879</wfw:commentRss><description>&lt;p&gt;Good idea DJay! Using the secondary DOM will make it much faster.&lt;/p&gt;</description></item><item><title>Re: Subset of Nodes from Nodelist by Index range</title><link>https://www.infopathdev.com:443/forums/thread/24871.aspx</link><pubDate>Mon, 03 Dec 2007 21:59:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:24871</guid><dc:creator>djay</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/24871.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=24871</wfw:commentRss><description>&lt;p&gt;In addition to not showing them all at once, you can speed up the operation considerably by doing most of the work outside of the primary data source and only doing one add operation to the main source.&lt;/p&gt;
&lt;p&gt;It will look something like this (in C#):&lt;/p&gt;
&lt;p&gt;--------------------------------------------&lt;/p&gt;
&lt;p&gt;IXMLDOMNode parent = oLocalDom.selectSingleNode(&amp;quot;/CachedList/Products&amp;quot;);&lt;/p&gt;
&lt;p&gt;IXMLDOMNode workParent = parent.cloneNode(true);&lt;/p&gt;
&lt;p&gt;/* ... Do work.&amp;nbsp; Append to workParent... */&lt;/p&gt;
&lt;p&gt;parent.parentNode.replaceChild(workParent,parent);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;----------------------------------------&lt;/p&gt;
&lt;p&gt;That sped things up considerably for me.&lt;/p&gt;
&lt;p&gt;I also did a paging type thing you are suggesting.&amp;nbsp; I inserted the first page and started a seperate thread to add the rest of the data in the background.&amp;nbsp; But that takes quite a bit of fiddling to get working.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As for parsing through the nodelist by index value.&amp;nbsp; You could always save the nSharedItem as a global variable and continue on from where you last stoped.&amp;nbsp; If you don&amp;#39;t want to do that you can use position() in XPATH and IXMLDOMNode.nextSibling.&lt;/p&gt;
&lt;p&gt;So to get the 11th item you would use:&lt;/p&gt;
&lt;p&gt;child = parent.selectSingleNode(&amp;quot;child[10]&amp;quot;);&lt;/p&gt;
&lt;p&gt;and to get the next item in the list: &lt;/p&gt;
&lt;p&gt;child = child.nextSibling;&lt;/p&gt;</description></item><item><title>Re: Subset of Nodes from Nodelist by Index range</title><link>https://www.infopathdev.com:443/forums/thread/24866.aspx</link><pubDate>Mon, 03 Dec 2007 21:01:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:24866</guid><dc:creator>justindevine</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/24866.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=24866</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;I will check that out.&amp;nbsp; I have an ugly solution I have come up with myself in the meantime.&amp;nbsp; I agree from the way it hangs it is definitely the rendering.&amp;nbsp; By the way do you know how to do what I was suggesting anyway?&amp;nbsp; Is there a way to parse through a nodelist by the index value?&amp;nbsp; I am going to post my ugly solution after this post , I am going to look for what you said now.&amp;nbsp; Thanks for the reply.&amp;nbsp; If I find something I will post as a reply.&lt;/p&gt;&lt;p&gt;-Justin&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Subset of Nodes from Nodelist by Index range</title><link>https://www.infopathdev.com:443/forums/thread/24864.aspx</link><pubDate>Mon, 03 Dec 2007 20:55:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:24864</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/24864.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=24864</wfw:commentRss><description>&lt;p&gt;Hi Justin,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I don&amp;#39;t think you&amp;#39;re problem is actually in adding the nodes to the XML, but displaying them in the view.&lt;/p&gt;
&lt;p&gt;Do this experiment:&amp;nbsp; Delete the repeating table from the view and run your code again.&lt;/p&gt;
&lt;p&gt;To remedy this, you can use some visual tweaks to make sure InfoPath is only displaying a few rows at a time.&amp;nbsp; 20 or 30 like you mentioned is a great number.&amp;nbsp; For some more advice, try searching around this site or others for something like &amp;quot;visual tweaks&amp;quot; &amp;quot;increase performance&amp;quot;.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Hope this helps!&lt;/p&gt;</description></item><item><title>Subset of Nodes from Nodelist by Index range</title><link>https://www.infopathdev.com:443/forums/thread/24858.aspx</link><pubDate>Mon, 03 Dec 2007 18:06:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:24858</guid><dc:creator>justindevine</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/24858.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=24858</wfw:commentRss><description>&lt;p&gt;I have a solution that is partially based on Matt&amp;#39;s blog post below&lt;/p&gt;&lt;h4 class="BlogPostHeader"&gt;&lt;a href="http://www.infopathdev.com/blogs/matt/archive/2006/04/10/Allow-Offline-Use-of-a-SharePoint-List-by-Caching-Locally.aspx" title="Allow Offline Use of a SharePoint list by Caching Locally"&gt;Allow Offline Use of a SharePoint List by Caching Locally&lt;/a&gt; &lt;span class="CommonRateControl" id="ctl00_ctl00_ctl00_bcr_bcr_bcr_ctl01"&gt;&lt;img src="http://www.infopathdev.com/Themes/InfoPathDev/images/common/star-left-on.gif" title="Poor" align="absmiddle" border="0" alt="" /&gt;&lt;img src="http://www.infopathdev.com/Themes/InfoPathDev/images/common/star-right-on.gif" title="Poor" align="absmiddle" border="0" alt="" /&gt;&lt;img src="http://www.infopathdev.com/Themes/InfoPathDev/images/common/star-left-on.gif" title="Fair" align="absmiddle" border="0" alt="" /&gt;&lt;img src="http://www.infopathdev.com/Themes/InfoPathDev/images/common/star-right-on.gif" title="Fair" align="absmiddle" border="0" alt="" /&gt;&lt;img src="http://www.infopathdev.com/Themes/InfoPathDev/images/common/star-left-on.gif" title="Average" align="absmiddle" border="0" alt="" /&gt;&lt;img src="http://www.infopathdev.com/Themes/InfoPathDev/images/common/star-right-on.gif" title="Average" align="absmiddle" border="0" alt="" /&gt;&lt;img src="http://www.infopathdev.com/Themes/InfoPathDev/images/common/star-left-off.gif" title="Good" align="absmiddle" border="0" alt="" /&gt;&lt;img src="http://www.infopathdev.com/Themes/InfoPathDev/images/common/star-right-off.gif" title="Good" align="absmiddle" border="0" alt="" /&gt;&lt;img src="http://www.infopathdev.com/Themes/InfoPathDev/images/common/star-left-off.gif" title="Excellent" align="absmiddle" border="0" alt="" /&gt;&lt;img src="http://www.infopathdev.com/Themes/InfoPathDev/images/common/star-right-off.gif" title="Excellent" align="absmiddle" border="0" alt="" /&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p&gt;&amp;nbsp;However when pushing large nodelists into a local DOM&amp;nbsp; (over 100 entries or so) this can have very bad performance, sometimes mine even hangs.&amp;nbsp; Therefore, I want to do this operation in parts as the user requires more info.&amp;nbsp; Somewhat of a pagination function.&amp;nbsp; So... where Matt does the following&lt;/p&gt;&lt;p&gt;&lt;font style="font-size:10pt;" color="#333399" face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while( (nSharedItem = nlSharedItems.nextNode() ) != null )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Create a new row from the sample&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var nNewLocalCacheRow = nSampleProductNode.cloneNode(true);&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font style="font-size:10pt;" color="#333399" face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Set the values&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nNewLocalCacheRow.selectSingleNode( &amp;quot;@ID&amp;quot; ).text = nSharedItem.selectSingleNode( &amp;quot;@ID&amp;quot; ).text;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nNewLocalCacheRow.selectSingleNode( &amp;quot;@Name&amp;quot; ).text = nSharedItem.selectSingleNode( &amp;quot;@Name&amp;quot; ).text;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nNewLocalCacheRow.selectSingleNode( &amp;quot;@Description&amp;quot; ).text = nSharedItem.selectSingleNode( &amp;quot;@Description&amp;quot; ).text;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font style="font-size:10pt;" color="#333399" face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Append to to our local cached list&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oLocalDom.selectSingleNode( &amp;quot;/CachedList/Products&amp;quot; ).appendChild( nNewLocalCacheRow );&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I just want to do it by 20, or 30 or some lower number.&amp;nbsp; so my goal is basically to&amp;nbsp; get the first 20 nodes throw them into the cached DOM, then do a .removeAll() and throw the next 20 or 30 in, rinse, repeat until null is returned indicating the end of the list.&amp;nbsp; Now I am no XML parsing guru.&amp;nbsp; I have searched around for about 2 hours trying to find some code like this.&amp;nbsp; I assume it would use the item() method, but maybe it wouldn&amp;#39;t have to since once you have the remote DOM you can loop through it like an array.&amp;nbsp; My plan for the counter is to have an external two variables that start a 0 and my increment with each iteration.&amp;nbsp; So x= 0 y = 20.&amp;nbsp; On each loop x = y; y= y+20. Please help me out if you can.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;-Justin&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>