Help with XPathNodeIterator in Repeating section. - InfoPath Dev
in

InfoPath Dev

Help with XPathNodeIterator in Repeating section.

Last post 04-23-2013 04:06 PM by Treasurydude. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-22-2013 10:36 PM

    Help with XPathNodeIterator in Repeating section.

    I have 2 text fields inside a Repeating section and I am collecting all the info entered in fields inside repeating section into a single string.. I am not sure what i am doing wrong here in my code.

    The XPathNodeIterator just does not get the next section and the rows pointer just points at starting row and it just displays info from first repeating section and not subsequent sections.

     

     any help is much appreciated.. 

     

    public void repeat_section_Clicked(object sender, ClickedEventArgs e)

    {

    // Write your code here.

    XPathNavigator domNav = MainDataSource.CreateNavigator();

    XPathNodeIterator rows = domNav.Select("/my:myFields/my:group1/my:group2", NamespaceManager);

    string fld = string.Empty;while (rows.MoveNext())

    {

    string field1 = rows.Current.SelectSingleNode("/my:myFields/my:group1/my:group2/my:field2", NamespaceManager).Value;

    string field2 = rows.Current.SelectSingleNode("/my:myFields/my:group1/my:group2/my:field3", NamespaceManager).Value;

    //message.Show(field1 + "\n" + field2);

    fld = fld + field1 + field2 +"\n" ;

    }

    MessageBox.Show(fld);

     

     

     

     

     

    }

     

     

     

     

  • 04-23-2013 07:22 AM In reply to

    Re: Help with XPathNodeIterator in Repeating section.

    You are using absolute XPaths instead of relative. Try this, for example:

    string field1 = rows.Current.SelectSingleNode("my:field2", NamespaceManager).Value;

    Hilary Stoupa

  • 04-23-2013 04:06 PM In reply to

    Re: Help with XPathNodeIterator in Repeating section.

    Thanks it worked

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.