0 votes
in Xpath Interview Questions by
What Are The Different Xpath Axes?

1 Answer

0 votes
by

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:

  1. ancestor: It is used to get all ancestor (parent, grandparent etc) of current node.
  2. ancestor-or-self: It is used to get all ancestors (parent, grandparent, etc.) of the current node and also the current node.
  3. attribute: It is used to get all attributes of the current node.
  4. child : It is used to retrieve all children of the current node.
  5. descendant: It is used to get all descendants (children, grandchildren, etc.) of the current node.
  6. namespace: It is used to get all namespace nodes of the current node.
  7. preceding: It is used to get everything in the document that is comes before the start tag of the current node.

Related questions

0 votes
asked Jul 24, 2021 in Xpath Interview Questions by Robindeniel
0 votes
asked Jul 26, 2021 in Xpath Interview Questions by SakshiSharma
...