• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Memory Problem

 
Luciano A. Pozzo
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am with a memory problem because we are loading a big xml for a simple update. Actually, I just want to put a new tag or just change some value. I do not want to load all the xml for it.

So, how can I solve this problem? I tried SAX, but... SAX just read! Any idea?

The current method, with DOM:




Thank's
[ July 20, 2007: Message edited by: Luciano A. Pozzo ]
 
Paul Clapham
Sheriff
Posts: 21152
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chapter 8 (SAX Filters) of this online book should help you out.
 
Luciano A. Pozzo
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hummm... ok, understood.
Just for explain what I tested:

The main ideia is to change the data manipulated by the handler before the handler execute. So I do not have to load all the XML in memory (with the DOM).

But I still have to do a thing! Take all the out that I created(the xml with the changes) and substitute the current XML. For me sounds a little weird and dangerous. But I guess that is the best sollution.

Next, the snippet of the code:

The Main



A snippet of the first ContentHandler that 'intercept' the other (called parent).
The code, bellow, add a tag 'NEW_TAG' before any element start.



Thank's Paul for the link
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic