When performing the transformations, we sometimes find ourselves in a situation where there is no single operation to perform a transformation the way we want. For example, let's say we would like to first trim two strings and then concatenate them. Since we don't have a single function to perform the task, the XSLT mapper in JDeveloper offers us the functionality of the chaining functions. In this recipe, we will examine how to chain the functions in order to present the complete information from the source to the target content.
We will amend the example from the Using the functions in the transformation operations recipe. We will amend the BPEL process so that we now map the correct source content to the target content.
price
element with its money unit. First, we open the XSLT mapper.price
element with the margin.price
element of the target part./ns0:TempElement/ns0:pieces[6]
.We are able to chain the functions in order to fulfill the needed transformation. JDeveloper, with its XSLT mapper, shows the chain of functions. However, the functions are interpreted as simple operations in the XSL file. Let us check the code from our XSL file, where we used the chaining as follows:
<client:price> <xsl:value-of select = "concat(/ns0:TempElement/ns0:pieces[5] * 1.05,/ns0:TempElement/ns0:pieces[6])"/> </client:price>
We can see that there is no multiply function. It is simply a star sign indicating the multiply operation in XSLT. Furthermore, the concat function presents a standard operation for the string
concatenation in the XSLT specification.