TOS and reading XML file with object structure

One Star

TOS and reading XML file with object structure

Hello everybody,

I want to read some XML files which have an object structure (XSD Schemas existing as well) and then compare those read XML files with an already existing entries in a DB.

I have no problems with the DB whatsoever. The problem is that those XML files are not flat files but rather XML files representing Objects (e.g. with an object structure).

Example XML file:

<ROOT>
<Farm ID="433"
AnimalGroupID="PIGS" tag="01">
<Desc language="deu">Schweine</Desc>
<Desc language="eng">Pigs</Desc>
<Desc language="fra">Porcs</Desc>
<Prefix>102</Prefix>
<Prefix>103</Prefix>
<Prefix>104</Prefix>
<Serial ID="EBAN"/>
<Serial ID="EBAF"/>
<Serial ID="EBAH"/>
<Type ID="KVOTIPUKA"/>
<Group ID="IAJLAINA"/>
<Group ID="IAJLAINO"/>
<Group ID="IAJGOMNA"/>
</Farm>
<Farm ID="434">
AnimalGroupID="DOGS" tag="02">
...
...
...
</Farm>
</ROOT>


The problem is that I can not read this file with TOS (or at least I don't know which is the proper way to do it) so I would be really thankful if someone could help me with this - I am desperate Smiley Happy

I tried tFileInputXML(only reads the first of Desc, Prefix, Serial or Group) and tFileInputMSXML but neither one works for me (or I am just retarded and simply can't make any of them work).



Thank you very much in advance!

George
One Star

Re: TOS and reading XML file with object structure

It seam that reading and writting complexe XML with TOS is difficult or impossible. I read various post on it but they are often without answer. I post something about writting an XML file that look like yours but no solution for the moment.

The only way to read such a file seem to be reading various schemas : One looping on the des, one looping on the prefix, one looping on serial ....
One Star

Re: TOS and reading XML file with object structure

Thanks for the response man! Smiley Happy


> "The only way to read such a file seem to be reading various schemas : One looping on the des, one looping on the prefix, one looping on serial ...."

Yeah that was what I've tried as well - and it works, but then I have the problem that I loose the information about which Desc, Pref, etc. are part of which Farm...and I need this information.

Maybe you could enlighten me as of how it would be possible to maintain this information while parsing the XML file multiple times with different schema?


Thanks and Best Regards,

George
One Star

Re: TOS and reading XML file with object structure

I think something like this can work ...

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Have you checked out Talend’s 2019 Summer release yet?

Find out about Talend's 2019 Summer release

Blog

Talend Summer 2019 – What’s New?

Talend continues to revolutionize how businesses leverage speed and manage scale

Watch Now

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog