Formatting an XML string - 7.1

Talend Data Management Platform Studio User Guide

EnrichVersion
7.1
EnrichProdName
Talend Data Management Platform
EnrichPlatform
Talend Studio
task
Design and Development

It is easy to run the replaceSpecialCharForXML routine along with a tJava component, to format a string for XML:

System.out.println(TalendString.replaceSpecialCharForXML("Thelma & Louise"));

In this example, the & character is replaced in order to make the string XML compatible: