Merge 2 XML documents

Dedicated to DataStage and DataStage TX editions featuring IBM<sup>®</sup> Service-Oriented Architectures.

Moderators: chulett, rschirm

Post Reply
bakul
Participant
Posts: 60
Joined: Wed Nov 10, 2004 2:12 am

Merge 2 XML documents

Post by bakul »

Is there anyway to merge 2 XML documents. I don't want to concat them,I want to merge them.

I have 2 transformers generating 2 different XML's but the output has to be a single XML.Is there any way to accomplish this?

Thanks and Regards,
Bakul

:?:
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

Have you looked at the Merge stage? You would send the output of the transformers to a merge stage and then to an XML stage.
bakul
Participant
Posts: 60
Joined: Wed Nov 10, 2004 2:12 am

Post by bakul »

A merge stage cannot be used in this scenario because a merge stage takes no inputs. The xml documents to be merged are generated in the job itself. Also,any passive stage with both an input and output link cannot be used in an RTI enabled job.
Regards,
Bakul
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

Good point, the other stage is the link collector, which will bring them into a single stream and let you use column ordering to mix them up. You might be able to output it as a single XML document. The XML output stage may do the merge for you.
mee
Participant
Posts: 23
Joined: Sat Mar 20, 2004 12:22 am
Location: None

Post by mee »

Vincent,

Thanks for the reply. I have the following situation.

Suppose, for example one XML file has store name and store id. The other XML file has store id, product id and product name.

The target XML file to include all the products in a given store before moving to the next store.

In that scenario, will this solution work? Or would I need to do something different?

Thanks for any help.
Post Reply