Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[TOS 3.0.4] problem when importing xml CDATA to mysql

Hi,
I need to import into a mysql database an xml file in which every data, numerical or textual, is inside a CDATA tag, for example:
<product_key>
<!]>
</product_key>
and
<station_libelle>
<!]>
</station_libelle>
I have found no good solution to do this. If the data is numerical, when I create a file xml metadata in the repository and indicate the type as numerical I will get an error at the execution of a basic job using file_xml_input and mysql_output, "wrong type". If I indicate the type as string there is no error but the CDATA is deleted and replaced by spaces and \n, so I need to clean the datas in mysql using trim and replace functions.
Is there a way to do a clean import directly in Talend ?
Thanks in advance for your help
Jérôme
Labels (4)
2 Replies
Anonymous
Not applicable
Author

Hello
Is there a way to do a clean import directly in Talend ?

Set the data type as string and use the method provided by Talend,
StringHandling.TRIM(String s)
see my screenshot
Best regards

shong
Anonymous
Not applicable
Author

Hi,
Thanks a lot for your help.
Best regards.
Jérôme