Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

creating separate xml documents  RSS feed

 
vanita maram
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a big xml document which contains 67 individual documents of the same kind. I need to break this big xml into individual documents and save them as individual xml docs. I am new to Java and was wondering if there is a way to do this using Java.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, welcome to the ranch!

You could try to do this with String manipulation, but it's safer to parse the big doc, construct smaller ones in memory, then write them to disk. There are several good parsing options. I'd probably favor a DOM parser for this because it will have methods to easily copy or write out your individual documents. Scroll on down to the XML and Related forum and ask for introductory tips to parsing.

Hope that helps!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!