Iterating through repeating sections - InfoPath Dev Sign in | Join | Help in Code InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » Code » Iterating through repeating sections Iterating through repeating sections Last post 09-15-2009 09:48 AM by sshines. 2 replies. Page 1 of 1 (3 items) Sort Posts: Oldest to newest Newest to oldest Previous Next 09-15-2009 08:24 AM sshines Joined on 06-23-2009 Posts 10 Iterating through repeating sections Reply Contact HELP! I have been over this code a million times and cannot figure out what I am doing wrong. I have a repeating section. I can retrieve the data from the first section, but cannot retrieve the data from the second section. What am I missing? Dim oNodes As IXMLDOMNodeList Dim oNode As IXMLDOMNode Dim i As Integer Dim junk As StringoNodes = thisXDocument.DOM.selectNodes("/dfs:myFields/dfs:dataFields/d:Employee/d:EmpEmergContacts")For i = 0 To oNodes.length - 1 oNode = oNodes.nextNode If Not (oNode Is Nothing) Then junk = oNode.selectSingleNode("/dfs:myFields/dfs:dataFields/d:Employee/d:EmpEmergContacts/@EmergFirstName").text End If Next Filed under: API references, Code, contact selector control repeating table infopath, 2003 Object Model 09-15-2009 09:32 AM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,297 Re: Iterating through repeating sections Mark as Not AnswerMark as Answer... Reply Contact Hi: It is your XPath in this line: junk = oNode.selectSingleNode("/dfs:myFields/dfs:dataFields/d:Employee/d:EmpEmergContacts/@EmergFirstName").text You should use a relative XPath, like: junk = oNode.selectSingleNode("@EmergFirstName").text Hilary Stoupa 09-15-2009 09:48 AM In reply to sshines Joined on 06-23-2009 Posts 10 Re: Iterating through repeating sections Mark as Not AnswerMark as Answer... Reply Contact Thank you that worked! I knew it was something simple. I have been struggling with this for 3 days now and I could not find any documentation out there to explain what I was trying to do. You are the best. Thank you. Page 1 of 1 (3 items) Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
HELP! I have been over this code a million times and cannot figure out what I am doing wrong. I have a repeating section. I can retrieve the data from the first section, but cannot retrieve the data from the second section. What am I missing?
oNode = oNodes.nextNode
junk = oNode.selectSingleNode(
Hi:
It is your XPath in this line:
junk = oNode.selectSingleNode("/dfs:myFields/dfs:dataFields/d:Employee/d:EmpEmergContacts/@EmergFirstName").text
You should use a relative XPath, like:
junk = oNode.selectSingleNode("@EmergFirstName").text
Thank you that worked! I knew it was something simple. I have been struggling with this for 3 days now and I could not find any documentation out there to explain what I was trying to do.
You are the best. Thank you.