XPath Predicates identifier expression for finding XPath node in XML document. XPath predicates identifier location path return boolean result either True or False.
you can use any relation operators <, >, <=, >=, =, != and boolean operator or, and.
Following are some predicates identifier expression for finding XPath nodes.
element_name[N] Opening and closing square bracket referring to a specific element sequence number (array sequence).
Select second employee of empinfo element.
Select name element of second employee element of empinfo element.
Select all employee element with given id attribute.
Finding employee elements with given attribute and value. Matching only those elements whose attribute and value are specified in XPath expression.
empinfo/employee[@id=2] Select all employee element of given attribute and value. At last select only second employee element.
empinfo/employee[@id=1] Select first employee element with given attribute and value.
//designation[@discipline and @experience] Selects all the designation element with given first and second both attribute.
//designation[@discipline | @experience] Select all the designation element with given either first or second, both attribute.
empinfo/employee: Select second employee of empinfo element.
empinfo/employee/name: Select name element of second employee element of empinfo element.
empinfo/employee[@id]: Select all employee element with given id attribute.
empinfo/employee[@id=2]: Finding employee elements with given attribute and value. Matching only those elements whose attribute and value are specified in XPath expression.
empinfo/employee[@id=2]: Select all employee element of given attribute and value. At last select only second employee element.
empinfo/employee[@id=1]: Select first employee element with given attribute and value.
//designation[@discipline and @experience]: Selects all the designation element with given first and second both attribute.
//designation[@discipline or @experience]: Select all the designation element with given either first or second, both attribute.
//designation[@discipline | @experience]: Select all the designation element with given either first or second, both attribute.