File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I split one XML file into Two files

 
BalaiahRaju ChamarthiRaju
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a task need to split one xml file into two files. this is because of my application supports only 5MB xml to load.. rarely I am getting 10MB files also, such scenarios my application is not able to load the file.

Please give me light on this whether is there any tool or any mechanism to split XML file.

Thanks in Advance
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well you could write a piece of custom Java which split the file if if gets beyond a certain file size. The tricky part will be deciding where to split that file and whether or not you need to merge that file back together...
 
Paul Clapham
Sheriff
Pie
Posts: 20187
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to extract a subset of the file (a generalization of your "split one file into two files"), a common way to do that is with a SAX filter. Google the expression for examples.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic