Four Stars

XML-Input with multiple xpath loop

Hi, 

i have to read from a XML-file with more than one "Main" Loop.

positions.JPG

One is Positions with 3 rows, Ordernumber 100,101,102 and the other is Foot with to Charge , 1 and 2

My Problem is when i set the absolute xpath to Positions i get all porsitions but only the first Charge.

If i set it to charges i get the two Charge but only the first Position.

xpath.JPG

 

Is it possible to get it both and the write it to a similar XML as the Input file?

1 ACCEPTED SOLUTION

Accepted Solutions
Twelve Stars

Re: XML-Input with multiple xpath loop

OK, to start I should say that this can be painful. It is not pleasant to work with XML like this with any product. However Talend does have the Talend Data Mapper in the Enterprise Edition. If you have that, use it. It isn't like ANY of the other Talend components, can be a real pain to find documentation, but once you get used to it, it really does help. If you are using the Open Source product, you are left with using multiple tExtractXMLField components. I gave an explanation as to how to do this here (https://community.talend.com/t5/Design-and-Development/Complex-XML-with-multiple-loops-into-one-outp...). At some point I will put together a mini tutorial, but you will learn a lot if you try this out yourself from the description I have given. As I said, it is not pretty, but once you get to grips with it, it isn't so hard.

Rilhia Solutions
1 REPLY
Twelve Stars

Re: XML-Input with multiple xpath loop

OK, to start I should say that this can be painful. It is not pleasant to work with XML like this with any product. However Talend does have the Talend Data Mapper in the Enterprise Edition. If you have that, use it. It isn't like ANY of the other Talend components, can be a real pain to find documentation, but once you get used to it, it really does help. If you are using the Open Source product, you are left with using multiple tExtractXMLField components. I gave an explanation as to how to do this here (https://community.talend.com/t5/Design-and-Development/Complex-XML-with-multiple-loops-into-one-outp...). At some point I will put together a mini tutorial, but you will learn a lot if you try this out yourself from the description I have given. As I said, it is not pretty, but once you get to grips with it, it isn't so hard.

Rilhia Solutions