In the Graphical Data Mapping editor, you can use the fn:concat transform to create a string output element that is the result of concatenating simple input elements.
The XPath 2.0 function fn:concat(arg1, arg2, ,,,) takes two or more arguments, converts them to their string representation, and concatenates them, returning a single string.
The fn:concat transform is the representation of the fn:concat XPath function in the Graphical Data Mapping editor.
You can have any number of inputs to the fn:concat transform. These inputs are used to define the arguments of the fn:concat function.
For more information about XPath, see XPath tutorial or
W3C XML Path Language (XPath)
2.0.
You can use fn:concat to concatenate input elements.
You can connect simple elements to the fn:concat transform.
Simple input elements that are not of type xs:string will be cast to xs:string.
The following figure shows two inputs connected to the fn:concat transform:
The fn:concat function has two or more non-repeating arguments.
You define the number and the order of the arguments to the fn:concat function in the General tab of the fn:concat transform properties view.
In the following figure, the fn:concat transform has two inputs. Each input is used as an argument of the fn:concat function:
In the following figure, the fn:concat transform has three inputs, whilst the fn:concat function only requires two arguments. Two of the inputs are used to define one of the arguments of the fn:concat transform:
You can use any of the input elements to the fn:concat transform to define a conditional expression that defines the condition under which the transform is applied. If the condition evaluates to true, the transform is applied.
For more information, see Configuring the properties of a transform.
This example shows how to use the fn:concat transform to concatenate multiple input elements and set the value of a string element by using the fn:concat function.
The arguments to the XPath function include a prefix, two elements, and one suffix. One of the arguments is set by an XPath function base on calculations from data from two inputs. One of the arguments is set with data from an input. The prefix and the suffix are literals.
<NewElement>
<A>My FieldA</A>
<B>B1</B>
<C>Field_1</C>
<D>4</D>
<E>FIELD_E</E>
</NewElement>
<NewElement1>
<a>MyPrefixtrueFIELD_EMySuffix</a>
</NewElement1>