Google News
logo
XPath - Interview Questions
What are the different XPath Axes?
XPath axes are used to set relation of current node with another node. A list of XPath axes to set relation with other nodes are :
 
ancestor : It is used to get all ancestor (parent, grandparent etc) of current node.

ancestor-or-self : It is used to get all ancestors (parent, grandparent, etc.) of the current node and also the current node.

attribute : It is used to get all attributes of the current node.

child : It is used to retrieve all children of the current node.

descendant : It is used to get all descendants (children, grandchildren, etc.) of the current node.

namespace : It is used to get all namespace nodes of the current node.

preceding : It is used to get everything in the document that is comes before the start tag of the current node.

Advertisement