wood burning stoves*
The moose likes XML and Related Technologies and the fly likes Concatenating XML Docs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Concatenating XML Docs" Watch "Concatenating XML Docs" New topic

Concatenating XML Docs

Med Shabe
Ranch Hand

Joined: May 08, 2001
Posts: 84
I need suggestions for concatenating XML documents.
Would it be wiser to save the streams to files and then concatenate the needed elements using SAX or just do it with DOM? Considering that the size of each doc. could get 50+K, and also XSL will be applied to the final doc.
Snippets would greatly be appreciated.
[ April 15, 2003: Message edited by: Med Shabe ]
Tina Desai
Ranch Hand

Joined: Mar 13, 2003
Posts: 365
Youcan do what is called a two stage tranformation. Write one xsl to merge the two xml files and then to that xml file apply your final xsl.
Check the document() function for this.

Alongwith being a good coder, try to be a good professional as well!
Med Shabe
Ranch Hand

Joined: May 08, 2001
Posts: 84
Thanks for the pointer.
I checked the document() function and all the samples deal with merging physical files. Any way to merge docs in memory, without saving to file?
Thanks much.
I agree. Here's the link: http://aspose.com/file-tools
subject: Concatenating XML Docs
Similar Threads
Reading xml file
How to copy from 4 JTextFields to 1 JTextArea
Multiple values from Jlist to multiple columns selection
Need some advice with a JLabel issue.
Representing an xml