• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [TOS 3.0.4] problem when importing xml CDATA to mysql

#1 2009-06-23 16:13:48

jdemolliens
New member
Registered: 2009-06-23
Posts: 2

[TOS 3.0.4] problem when importing xml CDATA to mysql

Tags: [bug, CDATA, mysql, xml]

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>
         <![CDATA[301]]>
        </product_key>
and
<station_libelle>
       <![CDATA[Alpe d'Huez]]>
      </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

Offline

#2 2009-06-24 05:21:58

shong
Talend team
Registered: 2007-08-29
Posts: 10289
Website

Re: [TOS 3.0.4] problem when importing xml CDATA to mysql

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


Uploaded Images


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#3 2009-06-24 10:13:08

jdemolliens
New member
Registered: 2009-06-23
Posts: 2

Re: [TOS 3.0.4] problem when importing xml CDATA to mysql

Hi,

Thanks a lot for your help.

Best regards.

Jérôme

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [TOS 3.0.4] problem when importing xml CDATA to mysql

Board footer

Powered by FluxBB