Predicate specifies XPath expressions written in square bracket. It is used to restrict the selected nodes in a node set for some conditions. See the use of predicate in the "employee" example.
XPath Predicate Example
Let's take an example to create a table of <employee> element with their details, by iterating over each employee. This example uses predicate to calculate the position of the employee node and then print the employee details.
Note:In the above example, you can see that all four queries are fetched.