how to get the most deeply nested element nodes using xpath? (implementation with XMLTWIG)
问题 I need to extract (XSLT, xpath, xquery... Preferably xpath) the most deeply nested element nodes with method (DEST id="RUSSIA" method="delete"/>) and his direct ancestor (SOURCE id="AFRICA" method="modify">). I don't want to get the top nodes with methods ( main method="modify"> or main method="modify"> ). The deepest nested elements with method correspond to real actions. The top elements with method actually are dummy actions that must not be taken into account. Here is my XML sample file: