Skip to main content

Merging xml response

1 reply [Last post]
mohitanchlia
Offline
Joined: 2006-04-24

Could somebody advise about how can I merge 2 xml documents that confirms to one schema into one document? Could I do that using JAXP(xslt)?

For eg: if site A sends a and site B sends b then transform it to ab

there are certain rules that I need to look for that's why I was wondering if I could do that using xslt.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mohitanchlia
Offline
Joined: 2006-04-24

So I looked around and found below example to merge xml:

(The first file)


1st Book
2nd Book
3rd Book

(The second file)


4th Book
5th Book
6th Book

I would like to have the following file:


1st Book
2nd Book
3rd Book
4th Book
5th Book
6th Book

The stylesheet for this problem is:







--
Now the only problem is that I don't have files. I have everthing in memory and it will be very expensive if I have to create files.

Is it possible to do this somehow in JAXP without having to give file names in document()? Or do you advise that I use DOM parser and write code for merging the output?