Page 1 of 1

Merge 2 XML documents

Posted: Wed Nov 24, 2004 7:11 am
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

:?:

Posted: Wed Nov 24, 2004 4:15 pm
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.

Posted: Wed Nov 24, 2004 10:06 pm
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.

Posted: Thu Nov 25, 2004 12:31 am
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.

Posted: Tue Jan 11, 2005 7:32 pm
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.