Conditional predicate

Suggested by a post in the eXist mailing list . The task is to select a subset of items with a conditonal filter.

1. Setup test data

This is just a snippet of data. More realistically this would be a large document which was indexed.

4. if expression in predicate from Adam Retter

The conditional expression can be used in a predicate but this would inhibit any indexes defined.

6. user defined function from Chris Wallace

user defined functions can be used in a path expression but this would also inhibit index usage.

7. util:eval from Chris Wallace

if there is a complex conditional predicate where we need to make best use of the indexes, then we canconstruct the expression as a string and use util:eval to evaluate it. In this simple example, the execution line is longer