The node-list constructed in the for-each control statement is reduced when the expression is followed by square brackets. The square brackets contain the predicate function—a functional expression that must evaluate positively if the node is to be considered within the code block of the for-each control statement.
Using the second example, it's possible to filter out the extraneous Loopback interfaces displayed in our simple JUNOS virtual environment:
adamc@router> op show-int-xpath Interface Status Local IP Addr Subnet Description em0.0 up 10.0.201.201 10.0.201/24 Management gre.0 up 188.8.131.52 3.0.1/24 lo0.0 up 184.108.40.206 Loopback
This is a very simple example of how to use XPath predicates to manipulate the structured data ...