Getting parent's parent from current node in Xpath 2.0 Getting parent's parent from current node in Xpath 2.0 xml xml

Getting parent's parent from current node in Xpath 2.0


The problem is in /[. You can change it to

../../self::*[@status='current']


A simpler solution than those from choroba and Hansen is

../..[@status='current']


You could also use the following:

parent::*/parent::*[@status='current']