• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Memory Problem

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic