• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » tFileInputXML read a multi level XML file

#1 2010-11-18 12:04:09

talendueuse
New member
Registered: 2010-11-17
Posts: 4

tFileInputXML read a multi level XML file

hello

I need to read a complex XML file.

like this one for instance :

<root>

<products>
   <product>
      <name> n</name>
      <price> 0 </price>
      <descriptions>
            <desc>
                        <name>blablabla </name>
                        <sub_desc>
                                    <name>name</name>
                                    <value>val</value>
                        </sub_desc>           
                         <sub_desc>
                                    <name>name</name>
                                    <value>val</value>
                        </sub_desc>
                       <sub_desc>
                          ...
                       </sub_desc>                   
            </desc>
            <desc> ...</desc>
            ...
      </descriptions>
     
   </product>
   <product>
     ...
   </product>
   ...
</products>
</root>


to read this file, I use first a tFileInput XML, that select a complete product block in a string, the checkbox "with nodes" is selected.
then i get the first level in a tExtractXMLField, and a string "descriptions" that contains all the block <descriptions>. then I read this in a tExtractXMLField, etc etc.


Is it the good way to read a multiple level XML file ?


In my example, I need to insert the data from the XML file into a mysql database with stored procedures.
As I have no output flow from a stored proc, I use a tmap to recover the values sent in input of the sp. I made a screenshot, because it's not easy to explain !


Thank you for your advises.


Uploaded Images

Last edited by talendueuse (2010-11-24 14:22:41)

Offline

#2 2010-11-24 14:21:46

talendueuse
New member
Registered: 2010-11-17
Posts: 4

Re: tFileInputXML read a multi level XML file

hi

I had to change the way I read my file, because it took 1h40 to read a 60 Mo xml file !

So now for each part of my file,  I have a tfileInputXML, a tmap and a mysql stored procedure component. -> 25 minutes.

I think 25 min is steel to much to read a file - 60 Mo is not a huge file - and I'm sure I'm not the only one who wants to read a complex XML file. I really need to be fast because all the process must be rollback if an error occurs.

However I can't find any solution in the forum.

Does anybody has an idea ?
Thank you

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » tFileInputXML read a multi level XML file

Board footer

Powered by FluxBB