Requirement: I have a scenario where I want to concatenate all the records of a Source field and map it to context variables in the target context schema in Data Mapping.
Resolution: To achieve your requirement, kindly follow the following steps:-
1. Create a Custom XSL before (CXB) on the context variable at the target schema and copy the below line of codes in it.
<xsl:for-each select="Root/Record"> // Xpath of the Source schema
<xsl:variable name="varGetValue" select="saxonJavaMappingTransformation:getVariable($_class,'TargetContextSchema','')"/>
<xsl:variable name="varConcat" select="concat($varGetValue,NAME)"/> //define the source field
<xsl:variable name="varSetValue" select="saxonJavaMappingTransformation:setVariable($_class,'TargetContextSchema',$varConcat)"/>
<xsl:value-of select="$varSetValue"/>
</xsl:for-each>
2. Now, create a local variable lets say "varGet" on the same target field and define its value as ' get-context( 'TargetContextSchema', '') '.
3. Map the local variable in the textual rule of the context variable.
Comments
0 comments
Article is closed for comments.