Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Conkers
Contributor III
Contributor III

XML with multiple loops

Hi

I have the below XML document:

<blah>
	<blahblah>
		<XXXX>
			<number>
				<value>111111</value>
			</number>
			<detail>
				<data>Source 1</data>
			</detail>
		</XXXX>
		<XXXX>
			<number>
				<value>222222</value>
			</number>
			<detail>
				<data>Source 2</data>
			</detail>
		</XXXX>
	</blahblah>
	<XXXXset>
			<XXXX>
				<number>
					<desc>aaaaaa</desc>
					<value>123456</value>
				</number>
				<detail>
					<data>Source 2</data>
				</detail>
			</XXXX>
			<XXXX>
				<number>
					<desc>bbbbbb</desc>
					<value>458745</value>
				</number>
				<detail>
					<data>Source 2</data>
				</detail>
			</XXXX>
			<XXXX>
				<number>
					<desc>cccccc</desc>
					<value>000000</value>
				</number>
				<detail>
					<data>Source 1</data>
				</detail>
			</XXXX>
			<XXXX>
				<number>
					<desc>dddddd</desc>
					<value>8888585</value>
				</number>
				<detail>
					<data>Source 1</data>
				</detail>
			</XXXX>
			<XXXX>
				<number>
					<desc>eeeeee</desc>
					<value>668885</value>
				</number>
				<detail>
					<data>Source 2</data>
				</detail>
			</XXXX>					
	</XXXXset>
</blah>

I'm trying to loop on both the <blahblah> element and the <XXXXset> element, and then join them based on the <data> element (either Source 1 or Source 2).

Is this possible?

Talend Open Source 7.2.1

TIA

 

 

 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi
It is possible, use two tFileInputXML components to read the two loop elements separately, and then join the two input data flow on tMap. eg:
tFileInputXML1--main--tMap----out1--->tLogRow
|lookup
tFleinputXML2
This article might be helpful for you.
https://community.talend.com/t5/Design-and-Development/Doing-an-inner-join-using-a-tMap-component/ta...

Regards
Shong

View solution in original post

2 Replies
Anonymous
Not applicable

Hi
It is possible, use two tFileInputXML components to read the two loop elements separately, and then join the two input data flow on tMap. eg:
tFileInputXML1--main--tMap----out1--->tLogRow
|lookup
tFleinputXML2
This article might be helpful for you.
https://community.talend.com/t5/Design-and-Development/Doing-an-inner-join-using-a-tMap-component/ta...

Regards
Shong
Conkers
Contributor III
Contributor III
Author

Thank you Shong, that was really helpful 🙂

 

Is there a way of combining the two tFileInputXML components with tWaitForFile or another way of selecting a file to run against this job?

 

TIA