Formatting an XML string - 7.1

Talend Big Data Studio User Guide

Version
7.1
Language
English (United States)
Product
Talend Big Data
Module
Talend Studio
Content
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: