Add Functions, Operators, and XSLT Statements
You can add functions, operators, and XSLT statements to your mappings.
Working with Functions
-
In the Target section, highlight the element node to which to connect.
-
In the upper right corner, click Toggle functions to launch the Components panel.
-
Expand Functions.
-
Select a function. For this example, String is expanded and concat is dragged to the target element node. The element can be an existing or ghost (not yet created) element.
A function icon is added to the Mapping Canvas section for the target element node and the function XPath expression is added to the Expression Builder at the bottom of the page. This icon indicates that a function is used in this mapping.
Note:
You can also initially drag functions to the Expression Builder and then connect the source element(s) to the function. -
In the Sources section, drag the source element nodes to the function in the Expression Builder. For this example, startTime and endTime are dragged to the two sides of the comma in the concat( , ) function in the Expression Builder. Do not drag source element nodes to the function icon in the Mapping Canvas section.
-
Click Save to save your updates.
Working with Operators
-
Expand the Operators section.
-
Drag an operator to the target element node (for this example, a = is added). The = operator is also added to the Expression Builder. The element node can be a created or ghost element node.
-
Drag appropriate source elements to both sides of the operator or manually enter values.
-
Click Save to save the operation.
The operator icon is displayed in the Mapping Canvas.
Working with XSLT Statements
- Click Toggle Functions .
-
Click XSLT.
An XSLT Constructors header is added to the Components panel.
-
Expand XSLT Constructors.
-
Browse for and drag the appropriate XSLT statement onto the target element node or use the search facility to manually enter and search for the XSLT statement.
Note the following conventions:
-
You can drag statements onto parent or child elements. Note the following conventions about dragging XSLT statements:
-
A green icon is displayed when you drag the XSLT statement to the front or the back of the element.
-
If a green icon is not displayed, you cannot insert as a parent.
-
Drag the statement to the end of the name to insert it as a parent.
-
Drag the statement to the front of the name to insert it as a child.
-
-
You can only drag XSLT statements onto created elements. If the element on which you want to drag the statement is grayed out (is a ghost node), right-click the element and select Create Target Node.
For example, drag an if statement to the target element, then map a source element to the target element.
Or drag a for-each statement to a repeatable element.
-