Node-set iteration with probe:for-each

In certain XPath expressions, it is convenient to iterate over an initial node-set before applying a further test to each node in the resulting set.

In XMLProbe 1.4, this can be achieved using probe:for-each:

<silcn:set-criterion>
<silcn:id>TEST-001</silcn:id>
<silcn:expression>number[. = 'one']</silcn:expression>
<probe:for-each>//numbers</probe:for-each>
<probe:message><probe:eval>.</probe:eval></probe:message>
</silcn:set-criterion>

In the above example, the expression contained in probe:for-each is evaluated first, retrieving all numbers elements in the document. The silcn:expression is then evaluated against each node in the resulting node-set, locating child number elements whose string value is equal to 'one'.

The following also applies to its usage: