Iterating through repeating sections - InfoPath Dev
in

InfoPath Dev

Iterating through repeating sections

Last post 09-15-2009 09:48 AM by sshines. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-15-2009 08:24 AM

    Iterating through repeating sections

    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 String

    oNodes = 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

     

  • 09-15-2009 09:32 AM In reply to

    Re: Iterating through repeating sections

    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

    Re: Iterating through repeating sections

    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.