Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Moe1
Contributor II
Contributor II

XML to Excel

Hello,

I have xml with the below format:

-<Document>

-<cltinf>

+<grphdr> (having many children)

+<pmtinf> (having many children and can be repeated with its children )

I want to extract them as columns which I am able to do that but the I want for each pmtinf occurrence to extract it as a new row, how to achieve this?

Labels (2)
4 Replies
Anonymous
Not applicable

Hello

Can you show an example to explain your requirement? what you are getting now? what are your expected output?

 

Regards

Shong

Moe1
Contributor II
Contributor II
Author

Yeah sure, let assume the below schema:

<grphdr>

<ch1>

<ch2>

<subch2>

.......

​</grohdr>

<pmtinf>

<pch1>

<pch2>

<pch3>

<subpch3>

.......

</pmtinf>

<pmtinf> (another occurrence of pmtinf; might be more than 2 occurrences)

<pch1>

<pch2>

<pch3>

<subpch3>

.......

</pmtinf>

I want the excel columns/row as follows:

Columns: grphdr, ch1, ch2, subch2, pmtinf, pch1, pch2, pch3, subpch3.

Rows: 2 rows, 1st row has values of grphdr and 1st pmtinf occurrence with its children. 2nd row has the values of grphdr and 2nd pm​tinf occurrence with its children.

Hope this clarifies!

Moe1
Contributor II
Contributor II
Author

mentioned below is my example.

Anonymous
Not applicable

@mohamad taha​, the tFileInputXML and tExtractXMLFields component don't support extracting data from different loop elements at a time. As a workaround, use different tExtractXMLFields components to extract data from each loop element, then merge all columns from the two outputs, please refer to this topic.

 

Regards

Shong