Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
LDPtechAFB
Contributor III
Contributor III

XML file loop

Hello, 

i'm beginning in Talend Studio, and i want to implement database with all the informations of my XML file. 

I tried with some component (tXMLmap, tmap, tWriteXMLfield, tlogrow), and i sent all datas in tfileoutputraw component (to verify that xml treatment work well).

But the issue is that have only one iteration of each tag. I tried to change the XPath, put a loop but i already have this issue.

cf: forum1.png show you the tree view of my XML file.

the issue is that element in my machines nodes have average 1000,1500 iterations and only one is send to the rawfile.

Hope you will understand my request.

Regards

 

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable

I think I see your issue. I am afraid I am a bit snowed under with some work that you guys should hopefully see the result of next week, but I may be able to give an example of how to extract this data if you can give me an example file with dummy data. Just make sure that the file has examples of all of the loops and this should do. Remember, make sure that it is dummy data

View solution in original post

9 Replies
Anonymous
Not applicable

I'm not entirely sure that I understand your issue I'm afraid. I *think* it might be related to this one that I provided a solution for. Can you take a look and let me know....

 

https://community.talend.com/t5/Design-and-Development/Complex-XML-with-multiple-loops-into-one-outp...

LDPtechAFB
Contributor III
Contributor III
Author

Yes it helped me a lot, to understand how it work !

I tried many things , but once datas go through the tExtractXMLField component, iterations are "deleted" and When i look (thanks to a Tlogrow component) before the component, all the datas are Ok, but when i look after, i only get one iteration.

 

The format of my datas looks like 

<Machine>

      <SpeciesGroupDefinition>

            <StemType>

            ...

            </StemType>

      </SpeciesGroupDefinition>

      <ProductDefinition>

            <DiameterClasses>

            ...

            </DiameterClasses>

      </ProductDefinition>

</Machine>

 

Tag : <SpeciesGroupDefinition> , <StemType> , <ProductDefinition> , <DiameterClasses> are repeating in the file. 

And I need all the informations if these tag. 

 

So I tried to Implement solution with flows replication and then using XMLExtract (forum2.PNG).

Then I configure my source tinputXML file like the forum1.PNG (HarvestProduction is the parent node of Machine).

and I replicate the flow, configure my extract component like forum3.PNG. 

But I get the result of forum4.PNG (Only one result instead of 7,8 iteration)

 

 

Hope you understand my problem Better 

 

regards 

 


forum5.PNG
forum3.PNG
forum2.PNG
forum1.png
forum4.PNG
LDPtechAFB
Contributor III
Contributor III
Author

Yes it helped me a lot, to understand how it work !

I tried many things , but once datas go through the tExtractXMLField component, iterations are "deleted" and When i look (thanks to a Tlogrow component) before the component, all the datas are Ok, but when i look after, i only get one iteration.

 

The format of my datas looks like 

<Machine>

      <SpeciesGroupDefinition>

            <StemType>

            ...

            </StemType>

      </SpeciesGroupDefinition>

      <ProductDefinition>

            <DiameterClasses>

            ...

            </DiameterClasses>

      </ProductDefinition>

</Machine>

 

Tag : <SpeciesGroupDefinition> , <StemType> , <ProductDefinition> , <DiameterClasses> are repeating in the file. 

And I need all the informations if these tag. 

 

So I tried to Implement solution with flows replication and then using XMLExtract (forum2.PNG).

Then I configure my source tinputXML file like the forum1.PNG (HarvestProduction is the parent node of Machine).

and I replicate the flow, configure my extract component like forum3.PNG. 

But I get the result of forum4.PNG (Only one result instead of 7,8 iteration)

 

 

Hope you understand my problem Better 

 

regards 

 

Anonymous
Not applicable

I think I see your issue. I am afraid I am a bit snowed under with some work that you guys should hopefully see the result of next week, but I may be able to give an example of how to extract this data if you can give me an example file with dummy data. Just make sure that the file has examples of all of the loops and this should do. Remember, make sure that it is dummy data

Anonymous
Not applicable

I think I see your issue. I am afraid I am a bit snowed under with some work that you guys should hopefully see the result of next week, but I may be able to give an example of how to extract this data if you can give me an example file with dummy data. Just make sure that the file has examples of all of the loops and this should do. Remember, make sure that it is dummy data

LDPtechAFB
Contributor III
Contributor III
Author

Hello,
Here is the file with dummy datas.

Thanks for your involvement.

 

I didn't find a solution yet.

i'm trying a lot, of things, consulting multiples post/forums but i think the issue is my lack of knowledge. Maybe i did something wrong. 

 

Thank you for your answers 


JDtest.xml
LDPtechAFB
Contributor III
Contributor III
Author

Hello,
Here is the file with dummy datas.

Thanks for your involvement.

 

I didn't find a solution yet.

i'm trying a lot, of things, consulting multiples post/forums but i think the issue is my lack of knowledge. Maybe i did something wrong. 

 

Thank you for your answers 

Anonymous
Not applicable

I have put together a quick job that I think covers what you want. Hopefully my screenshots will tell the story, but I will add some descriptions where I think more info is needed.

 

0683p000009MaG8.png

The above is a screenshot of the job. It is split into 3 paths; one for the Machine data, one for the SpeciesGroupDefinition data and one for the ProductDefinition data. This split takes place at the tMap_1.

 

The tFileInputXML_l just receives the XML and outputs an XML Document to the next component. This component is configured as below...



To see the whole post, download it here
OriginalPost.pdf
LDPtechAFB
Contributor III
Contributor III
Author

hello @Richard Hall

​, I saw your answer last week (but we cannot see it anymore, i have your answer in my mailbox but without the attached pictures), It helped me a lot.

The problem is that datas concatenate to other each time a TExtractRow send datas to another one (it create me a 0.5Gb file, while the original file is 0.005gb).

 

i tried to to extract datas One by one (node by node) to extract and send thanks to a TmapComponent and merge them, but the resultat is the same. 0693p000008v7q7AAA.png

 0693p000008v7qCAAQ.png

 (1024 rows)

 

don't want to have this amount of duplication

How can i associate the good iterations together ?