Example of the xslt plugin - Cloud - 8.0

Talend Studio User Guide

Version
Cloud
8.0
Language
English
Product
Talend Big Data
Talend Big Data Platform
Talend Cloud
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
Design and Development
Last publication date
2024-02-29
Available in...

Data Fabric

MDM Platform

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.