cancel
Showing results for 
Search instead for 
Did you mean: 

Appending multiple xml files to single xml file using File channel?

Former Member
0 Kudos

Hi Experts,

I would like to get some pointers around xml files append.

My sender application will send around 1000 messages through SOAP per day. But the target application needs single xml file formed by consolidation of all these 1000 files.

I tried with txt files and the receiver file channel could append the txt files. However, since xml files allow only one root node, I am not able to achieve the requirement.

Is there any option we can do to get the result?

The target file location is UNIX folder. Do we need to create any shell script to run from the channel for appending the file?

Do we need to use any XSLT mapping to strip the xml declaration tags and append the files. Once the single file is ready, using another file channel with XSLT mapping, insert a dummy root node and xml declaration tags to build an xml file?

Any thoughts to get the result will be much appreciated.

Thanks

Ray..

Accepted Solutions (0)

Answers (2)

Answers (2)

sunilchandra007
Active Contributor
0 Kudos

I tried with txt files and the receiver file channel could append the txt files. However, since xml files allow only one root node, I am not able to achieve the requirement.

Is there any option we can do to get the result?

1. First create the single txt file with append mode.

2. Convert the txt to xml with new scenario having file content conversion at sender file channel without any mapping.

Regards,

Sunil Chandra

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

You have two options

1)Using Receiver Sender File channel select mode append it does the job.

Option 2:

Using BPM we cann collect all messages per day and club them as a one message, in this case create Target data type root node occurance 1 to unbounded. so it cal hold multiples SOAP messages in only XML messages.

search in sdn for BPM collect pattrersn,its very simple .

Option 3:

Create scheell script in OS level and write a logic to append all files planced in FTP.

Regards,

Raj

Former Member
0 Kudos

Hi Raj,

I dont want to use BPM since its a constrain.

The receiver file channel setting for appending the files may not work with xml files.

Is there any problem in using shell script in OS level if network fails? How the reprocessing works? whether multiple files get generated due to reprocessing?

Please let me know...

Thanks

Ray..

rajasekhar_reddy14
Active Contributor
0 Kudos

I doont see any problem using Shell scripts but insted of executing Schell script from PI try to execute OS level and run at specific interval time.Better to check with UNIX guys they can help you to write good script.