Skip to main content

XPath Node Operators and Functions

XPath Node Operators

A list of operators on nodes to be used with XPath expressions:

OperatorDescription
/It is used to select node under a specific node.
//It is used to select node from root node.
[...]It is used to check node value.
|It is used for union of two node sets.

XPath Node Functions

A list of functions on nodes to be used with XPath expressions:

FunctionDescription
node()It is used to select all kinds of nodes.
processing-instruction()It is used to select nodes which are processing instruction.
text()It is used to select a text node.
name()It is used to provide the name of the node.
position()It is used to provide the position of the node.
last()It is used to select the last node relative to current node;
comment()It is used to select nodes which are comments.