Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
RA6
Creator
Creator

Iterate through multiple xml files with same schema

Hello,

 

I have a folder that contain a list of xml files with the same schema.

 

file1.xml

file2.xml

...

...

...

file3.xml

 

-------

 

 

--file1.xml

<?xml version="1.0" encoding="UTF-8"?>
<debtors>
    <debtor>
        <clientNum>14069</clientNum>
        <debtorReferenceNumber>aa3373f5ae604ff883b3686086626d</debtorReferenceNumber>
        <activityCode>53168</activityCode>
        <debtorName>Debtor_name_5441</debtorName>
     </debtor>
<debtors>

--file2.xml

<?xml version="1.0" encoding="UTF-8"?>
<debtors>
    <debtor>
        <clientNum>659789</clientNum>
        <debtorReferenceNumber>dfkshdfs sdfgjsd</debtorReferenceNumber>
        <activityCode>64511</activityCode>
        <debtorName>Debtor_name_657716</debtorName>
</debtor> <debtors> --Expected output <?xml version="1.0" encoding="UTF-8"?> <debtors> <debtor> <clientNum>14069</clientNum> <debtorReferenceNumber>aa3373f5ae604ff883b3686086626d</debtorReferenceNumber> <activityCode>53168</activityCode> <debtorName>Debtor_name_5441</debtorName> </debtor> <debtor> <clientNum>659789</clientNum> <debtorReferenceNumber>dfkshdfs sdfgjsd</debtorReferenceNumber> <activityCode>64511</activityCode> <debtorName>Debtor_name_657716</debtorName> </debtor>
<debtor>
...
...
...
</debtor> <debtors>

 

Can you advice please, how can i get the above expected output?

 

Thank you.

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi asadasing,

 

Please follow the below steps - 

 

1) Add tFileList component to read all the files.

2) Add tFileInputXML component to extract the input xml content (extract to the fields - clientNum, debtorReferenceNumber etc..).

3) Add tUnite to unite contents of the files.

4) At last add tAdvancedFileOutputXML component and configure the required XML there.

 

Hope that will help you !

 

 

Best Regards,

Abhishek

View solution in original post

2 Replies
Anonymous
Not applicable

Hi asadasing,

 

Please follow the below steps - 

 

1) Add tFileList component to read all the files.

2) Add tFileInputXML component to extract the input xml content (extract to the fields - clientNum, debtorReferenceNumber etc..).

3) Add tUnite to unite contents of the files.

4) At last add tAdvancedFileOutputXML component and configure the required XML there.

 

Hope that will help you !

 

 

Best Regards,

Abhishek

Anonymous
Not applicable

Hi Abhishek,

 

If you have any blog or detail explanation regarding this requirement then please share with me.

 

thanks in advance

Pravin