Single and List functions
The Mapper function modeler internally handles looping constructs such as “for-each". This makes constructing the required function simpler. Therefore, the available XSLT function tree does not contain looping construct functions.
The available XSLT functions generally expect either a single value per input parameter or a sequence of values (list) per input parameter. List functions are displayed within the Mapper function modeler available functions tree as Function name followed by an asterisk (*). For example, Join Strings* is a function that expects to receive a list whereas Concatenate does not.
In certain modeling scenarios, the scope of the function may mean that a function that normally expects a single value requires a list as input. Additionally a function that normally outputs a single value can output a list.
Example: You can create a mapping between a source and a target entity where both source and targets are Nodes, Elements or Attributes. The initial mapping of the source and target entities is always a one-to-one mapping. That is, those entities behave as a single entity. Where multiple source entities are added within the function modeler, the additional source entities can behave as a single entity or a group entity. The relative position of the additional source (B) entity with the original source entity (A) determine its behavior as if:
- B is a parent of A, and then B behaves as a single entity.
- B is a child of parent of A and is not a list [0..∞], and then B behaves as a single entity.
- B is a child of parent of A and is a list [0..∞], and then B behaves as a group-list entity.
- B is a child of A and is not list [0..∞], then B behaves as a single entity.
- B is a child of A and is a list [0..∞], then B behaves as a group-list entity.
A is the original source element that is mapped. Mapping additional source element B adheres to this rule: B is a parent of A; then B behaves as a single entity.
A is the original source element that is mapped. Mapping additional source element B adheres to these rules:
- Scenario 1
B and A belong to a common parent and as B is not a list, B behaves as a single entity.
- Scenario 2
B and A belong to a common parent and as B is a list, B behaves as a group entity.
A is the original source element that is mapped. Mapping additional source element B adheres to these rules:
- Scenario 1
B is a child of A and is not a list, then B behaves as a single entity.
- Scenario 2
B is a child of A and is a list, then B behaves as a group entity.
User-Defined Functions input and out parameters can be configured to either a single value input or a list (*) of values.
- Right-click the parameters field.
- Select Set input type as Single/List.