How to traverse back to the parent node in the XML file by using Xpath(using XSLT) query?

45,150

Use:

ancestor::node()[3]

or

../../..
Share:
45,150

Related videos on Youtube

Santosh kumar
Author by

Santosh kumar

...

Updated on July 09, 2022

Comments

  • Santosh kumar
    Santosh kumar almost 2 years

    Let us have a xml tree of depth N. I have traveresd the last node means i am at last note. Now i wanted to go back to some level up (say at N-3) in the xml tree from that last node.

    Please let me know the syntax for the XPATH query so that i can reached at intended node in the xml tree.

  • Admin
    Admin almost 14 years
    +1 for ancestor axe plus position predicate solution that can be parameterized