One Star

XML escape character

I use the tFileOutputXML to generate an XML file from a MSSQL database.
The XML is generated but is not valid in any XML editor.
In fact all special character (<,>,&, ', ") are not escaped. So the XML is not usable.

Is there any simple solution integrated in TALEND to escape.
< < less than
> > greater than
& & ampersand
&apos; ' apostrophe
" " quotation mark

It's not possible to make this transformation in a tMap component because it will
need to transform all the fields.

Thanks
Regards
7 REPLIES
Employee

Re: XML escape character

Hello
Can you precise your TOS Version and your project language ?
Michaël.
One Star

Re: XML escape character

TOS 2.1.0 M2 and Java language.
Employee

Re: XML escape character

Yes you're right.
As a work around, you can call a mapper before the tFileOutputXML and make this transformation on your columns : TalendString.replaceSpecialCharForXML(myRow.myCol);
Regards,
One Star

Re: XML escape character

Are there any plans to make this available through the GUI in the future? We have customers that need to export to XML but won't code in Java.
Thanks,
Jason
Employee

Re: XML escape character

Remenber that 2.1.0M2 is only a Milestone version.
This bug is a regression, values were automatically parsed in 2.0.XX version.
This will be corrected in 2.1 RC1 (Release Candidate 1)
Regards,
One Star

Re: XML escape character

OK thanks for this correction in the RC1
I've opened an issue in Mantis to follow.

Regards
One Star

Re: XML escape character

Hi ,
This is not working for me.