aspose file tools*
The moose likes Performance and the fly likes advice needed to translate bigger XML files above 2MB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "advice needed to translate bigger XML files above 2MB" Watch "advice needed to translate bigger XML files above 2MB" New topic
Author

advice needed to translate bigger XML files above 2MB

rajareddya reddy
Ranch Hand

Joined: Jul 23, 2011
Posts: 58
Hi All,

I am working on component that can translate XML files to other format likes EDI , text files etc.. .The limitation of this component is it can translate maximum 200kb xml files.

If I try to translate more than 200kb, applications which are using my component is going to HUNG state.

Can anybody suggest best industry approaches how to deal with BIG XML files more than 2 MB.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12825
    
    5
Assuming you are presently working from a DOM in memory, the obvious answer is to go to an event oriented SAX or StaX approach.

This is likely to involve a lot more programming but should remove all size limitations.

You might find a "pipeline" toolkit such as ServingXML to be helpful. That site has examples of conversions like yours.

Please realize that:
If I try to translate more than 200kb, applications which are using my component is going to HUNG state.

does not really tell us what is going on - how are these applications supposed to use the output of your component?

Bill
aadhira sharma
Greenhorn

Joined: Dec 13, 2012
Posts: 4
Thanks for share it with us.
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 8250
    
  23

rajareddya reddy wrote:Can anybody suggest best industry approaches how to deal with BIG XML files more than 2 MB.

Well, I can think of one: work out why your application needs to process such enormous files.

Frequently, it's simply laziness; often combined with the fact that usage has expanded over time, but nobody's actually bothered to go back and work out how the app could be refactored. Huge discrete inputs are often a symptom of neglect.

My 2 cents, for what it's worth.

Winston


Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: advice needed to translate bigger XML files above 2MB