One Star

how to convert xml to csv without specifying schema to tFileInputXML

Hi,
I want to convert XML file into CSV file. I have XML which doesn't have fixed format every time. So how I convert that XML file into CSV file without specify schema in the tFileInputXML component.
I have simply design my job like
tFileInputXML------> tFileOutputDelimited
(schema not fixed)
Please help me.
6 REPLIES
Moderator

Re: how to convert xml to csv without specifying schema to tFileInputXML

Hi,
First of all, you should make sure your XML file is well-formed and then you can use talend component tFileInputXML to retrieve your attribution into relational table.
Here is the related forums: Forum 12624
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: how to convert xml to csv without specifying schema to tFileInputXML

Hi Sabrina,
My XML file is well formatted but the schema in the file are not fixed every time. So what I have to specify in the schema of tFileInputXML? Is there any way to define dynamic schema?
Moderator

Re: how to convert xml to csv without specifying schema to tFileInputXML

Hi,
We have a "dynamic schema" feature, however, that is only available in Talend Enterprise Subscription Version, it allows you to design schema with an unknown column structure (unknown name and number of columns), however, tFileInputXML component does not support dynamic schema, so it is impossible to achieve your request.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Moderator

Re: how to convert xml to csv without specifying schema to tFileInputXML

Hi,
Here is a related forum Forum 29105, hope it will point you a light on dynamic schema in XML file.
Perhaps you can create a custom component for your case.componentCreation
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: how to convert xml to csv without specifying schema to tFileInputXML

Hi,
I'm using enterprise version of Talend so how I will convert xml to csv without specified schema?
Six Stars

Re: how to convert xml to csv without specifying schema to tFileInputXML

Hi,
I was facing similar situation :-), but my XML was full of different namespaces, etc. and I wasn't able to get it working like this. The more complex XML the more complex job...
So I found a temporary workaround, you can open any XML file as table in Excel (it worked excellent in my case). So this way you have 2 options how to automate it via talend:
On Windows:
Create java wrapper for comp objects and develop "Excel open XML as CSV"
On Linux:
Try to do the same with Apache-POI libraries. This will work on Windows as well of course.
Let me know about your success. I found Talend XML processing very poor especially in Web Service domain...
Ladislav