How to use position() in xpath? - InfoPath Dev
in

InfoPath Dev

How to use position() in xpath?

Last post 07-27-2006 12:50 PM by Greg Collins. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-27-2006 12:05 AM

    How to use position() in xpath?

    Hi, I encountered some difficulties when trying to use position() function in xpath.
    For example, I have a piece of XML like this:
    ....
    <Driver>
    <driverName>
    driverA
    </driverName>
    </Driver>
    <Driver>
    <driverName>
    driverB
    </driverName>
    </Driver>
    ....

    Now I want to display these driver names in a repeating section repectively. I added an expression box and input "//Driver[position()]/driverName" as xpath. But I found it did not work as it was supposed. It always returns the first element.

    Can anybody help me?

  • 07-27-2006 01:47 AM In reply to

    Re: How to use position() in xpath?

    Hello,

    Why do you want to use Position() when you can show all the names in the repeting Table by Binding the table to the XML?
    Open the repeating table forms and then select Change Binding and add the fields you want to show in the table.This way all the values return to the Table.

    Hope this helps you.

    Kalyan G Reddy
    Infopath MVP 2007 and 2008
  • 07-27-2006 12:50 PM In reply to

    Re: How to use position() in xpath?

    The "//" at the begining tells the XPath to start at the top. Just drag the driverName field into the appropriate column in your repeating table.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.