Preceding-sibling sub-path - InfoPath Dev
in

InfoPath Dev

Preceding-sibling sub-path

Last post 05-27-2009 06:55 AM by yo_pb. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 05-22-2009 08:01 AM

    • yo_pb
    • Not Ranked
    • Joined on 02-01-2008
    • Posts 5

    Preceding-sibling sub-path

    I have a form with a master/detail section. In the repeating table I have a section with contains 2 fields (I put it in a section so that I can hide the section if certain conditions are met).  The section contains a drop-down and a check-box.  If the person checks the box then it should set the drop-down equal to the preceding value.  I can get it to work if I don't put the fields into a section.  The section adds a sub-group to the repeating group:

    myFields
         group1
              group2 (repeating)
                   field1
                   field2
                   group3 (the section / sub-group to the repeating group)
                        field3 (the drop-down)
                        field4 (the check-box)

    I have a rule added to the check-box so that if selected it should set the current field equal to the preceding but nothing happens (I'm sure it is because I need to modify the xpath to account for the sub-group).

    If I don't use the section to hold the fields then "preceding-sibling::my:group2[1]/my:field3" works fine.  How do I modify it to account for when the field is a level deeper?

    Sorry if this is lengthy or confusing.

    Thanks.
    Pat

  • 05-25-2009 03:50 AM In reply to

    Re: Preceding-sibling sub-path

    Hi,

    Use the expression like,

    ../../preceding-sibling::my:group2[1]/my: group3/my:field3

    Swathip
    www.ggktech.com
  • 05-26-2009 07:29 AM In reply to

    • yo_pb
    • Not Ranked
    • Joined on 02-01-2008
    • Posts 5

    Re: Preceding-sibling sub-path

    I will give it a try.  Thanks!

  • 05-26-2009 12:33 PM In reply to

    • yo_pb
    • Not Ranked
    • Joined on 02-01-2008
    • Posts 5

    Re: Preceding-sibling sub-path

    Swathip - that worked.  Thanks for taking the time to read and respond to my post.

    One more thing - I haven't found much on the 'previous-sibling' command, can you explain what the "../../" at the beginning does?

    Thanks!

    Pat

  • 05-26-2009 10:19 PM In reply to

    Re: Preceding-sibling sub-path

    Hi,

    ../ means the parent node of the current node. Here  ../../ means the parent of parent of the current node.  For example, now you are at field3 and ../../ gives the group2 node.

    Swathip
    www.ggktech.com
  • 05-27-2009 06:55 AM In reply to

    • yo_pb
    • Not Ranked
    • Joined on 02-01-2008
    • Posts 5

    Re: Preceding-sibling sub-path

    Makes sense.  Thanks again Swathip.

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