<?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: Loop through Repeating Group w/subgroups</title><link>https://www.infopathdev.com:443/forums/thread/14947.aspx</link><pubDate>Thu, 07 Dec 2006 19:16:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14947</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14947.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14947</wfw:commentRss><description>Hi Dean,&lt;br /&gt;One easy way is to use recursion. Create a function for the code in your If block. Call this function and pass it the oNodeList element. Then, add an Else If block parallel to the NODE_ELEMENT check that includes a call to this function with the ONode as the parameter. Recursion means successively calling into the same function. Of course recursion is not a great coding practice because it can cause infinite recursion if you are not careful with conditions. In addition, it uses up a lot of stack space. However, it does result in the least amount of code. Good luck!</description></item><item><title>Loop through Repeating Group w/subgroups</title><link>https://www.infopathdev.com:443/forums/thread/13001.aspx</link><pubDate>Thu, 07 Dec 2006 16:22:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13001</guid><dc:creator>dlgross</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13001.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13001</wfw:commentRss><description>I am using the following to get the value from the top level of my group, how to I loop through sub and sub-sub groups (the number of which changes)?&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;      &lt;br /&gt;Dim oNodeList As IXMLDOMNodeList&lt;br /&gt;Dim oNode As IXMLDOMNode&lt;br /&gt;Dim oField As IXMLDOMNode&lt;br /&gt;oNodeList = thisXDocument.DOM.selectNodes("my:myFields/my:ProjEstimate/my:WBSSummary")&lt;br /&gt;If (oNodeList.length &amp;gt; 0) Then&lt;br /&gt;   For Each oNode In oNodeList&lt;br /&gt;       If (oNode.nodeType = DOMNodeType.NODE_ELEMENT) Then&lt;br /&gt;           oField = oNode.selectSingleNode("my:WBSNum")&lt;br /&gt;           thisXDocument.UI.Alert(oField.text)&lt;br /&gt;       End If&lt;br /&gt;    Next&lt;br /&gt;End If&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;TIA&lt;br /&gt;Dean</description></item></channel></rss>