Example of the xslt plugin - 7.3

Talend Data Fabric Studio User Guide

Version
7.3
Language
English (United States)
EnrichDitaval
Data Fabric
Product
Talend Data Fabric
Module
Talend Studio
Content
Design and Development

The following example parameters will loop over all the lines of the input XML and send them to the transformer as XML fragments:

<Country
    xrefCluster='MYCLUSTER'
    xrefIn='.=Country/Codes/ISO2, ../Customer/Name=[ACME]'
    xrefOut='Country/Name/FR'
><xsl:value-of select='State/CountryCode'/></Country>

The example above does the following:

  • The XSLT generates a <Country> element in the target document,

  • The content of State/CountryCode of the source document is inserted as the value of the element,

  • The rest of the xslt transformations complete,

  • The system queries the Country data in cluster MYCLUSTER where:Codes/ISO2Code is equal to State/CountryCode (the current value of the Country element), and /Customer/Name in the target document is equal to hard coded value ACME,

  • The matching Country document is returned and the value in Name/FR is extracted,

  • The value in Country of the target document is replaced with the extracted value.