XPath Query Syntax??? - InfoPath Dev
in

InfoPath Dev

XPath Query Syntax???

Last post 06-18-2005 07:36 AM by kfrost. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 06-16-2005 02:24 PM

    • kfrost
    • Not Ranked
    • Joined on 06-15-2005
    • Posts 4

    XPath Query Syntax???

    Hello,

    I'm rephrasing a previous post due to no response. I'm trying to figure out the xpath syntax to get the values from preceding-sibling and Following-siblings

    Say I have a data connection and each set of records returned has a TripID field. I want to assign a variable the value of the TripID of the preceding-Sibling or following-Sibling.

    Anybody know of how to do this? Here is the syntax to get the current nodes TripID value.

    xdXDocument:GetDOM("Trips")/dfs:myFields/dfs:dataFields/d:Trips/@TripID

    I would think it would have been something along the lines of:
    xdXDocument:GetDOM("Trips")/dfs:myFields/dfs:dataFields/d:Trips/../preceding-sibling/@TripID

    But I can't figure it out.

    Thanks.

    kris

  • 06-16-2005 04:32 PM In reply to

    Hello
    This link should give the appropriate info on how to use preceding-sibling and following-sibling to get your scenario to work.

    http://www.infopathdev.com/howto/tips/default.aspx?i=2d9c464bbf4146ae91bf66395dca34ad

    Shanthi
    InfoPathDev India
    Shanthi Reddy
  • 06-18-2005 07:22 AM In reply to

    • kfrost
    • Not Ranked
    • Joined on 06-15-2005
    • Posts 4
    Thank you but I understand the concept of moving back and forth through using preceding and following. The question is the correct xpath syntax in a Rule to accomplish this.

  • 06-18-2005 07:36 AM In reply to

    • kfrost
    • Not Ranked
    • Joined on 06-15-2005
    • Posts 4
    P.S.

    What I have working so far. Not sure it's optimal but to go to the first record, the following syntax appears to work.

    xdXDocument:GetDOM("Trips")/dfs:myFields/dfs:dataFields/d:Trips[preceding::node()]/@TripID

    To go to the last, the following works:
    xdXDocument:GetDOM("Trips")/dfs:myFields/dfs:dataFields/d:Trips[last()]/@TripID

    Ok, the following code for next record works the first time the button is clicked. Meaning the first time it's clicked, the next record will display. However any subsequent clicks, nothing happens.

    xdXDocument:GetDOM("Trips")/dfs:myFields/dfs:dataFields/d:Trips/following-sibling::*[1]/@TripID
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.