How do I Identify correct xpath? - InfoPath Dev
in

InfoPath Dev

How do I Identify correct xpath?

Last post 03-09-2012 09:36 AM by Anson Hidajat. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-08-2012 12:22 PM

    How do I Identify correct xpath?

    I have a form with code behind. I am using a dropdown as filter criteria for a second dropdown in a repeating section. If I use the full xpath to dd1 it will always filter from the dropdown in row 1. I want to filter by the current row. Still unfamiliar with xpaths can some lend some help?

    xpath filter =  /my:myFields/my:CommoditySummary/my:Line_Items/my:Commodity/my:Origination

    xpath field =  /my:myFields/my:CommoditySummary/my:Line_Items/my:Commodity/my:Destination

    I can never figure out if it is:

    • my:Origination
    • /my:Origination
    • //my:Origination
    • ../my:Origination
    Kind regards,
    Larry
    Filed under:
  • 03-09-2012 09:36 AM In reply to

    Re: How do I Identify correct xpath?

    If you want to get a specific row of repeating data you'll need to specify the row number in your xpath.  Something like: /my:myFields/my:CommoditySummary/my:Line_Items/my:Commodity/my:Origination[current()].  The index should be on whatever node is repeating, so that may be the commodity group in your case.  This is for the xpath, but not 100% sure if this translates into code or whether there is a code specific way to do this.
    Anson Hidajat
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

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