company logo

Selector operator in a path property

Selector elements are property names followed by a selector parameter. The selector operator can be used for selecting a specific instance in a path element:

persons("P0001").children().children()

In this example, the path returns all the grand children for the person with the person number ( pid ) P0001. With the selector operator, one may select a single instance in the path by position or constant or variable value, but you cannot define a filter condition. For defining filters, one may use an operation path.

The path will never iterate for selector elements, defining a selector element after an iteration element, iterating through the path automatically selects the instance in the selector element, when existing.

persons().children(0).name

When not existing (currently selected person does not have a child), the next person will be selected, i.e. the path above returns the name for the first child of all persons having children.

Instance selection is possible by key value or position or by an expression, in which case the value returned from the expression is interpreted as key value. The last case is an interesting feature, when using path properties in OSI expressions.