| Author |
Adding attributes to root tag
|
Greg Charles
Bartender
Joined: Oct 01, 2001
Posts: 2550
|
|
|
I need Java code to read a large XML message from a database, add several attributes to the root tag, and send it out over a network. Ideally, I'd like to avoid having the entire message in core memory. Doesn't SAX allow parsing without loading the whole file? I'd appreciate some tips. The database and network stuff I can do, but the XML manipulation is baffling to me.
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16487
|
|
A SAX filter is what you want here. There's a whole chapter of a book online that describes them: http://www.cafeconleche.org/books/xmljava/chapters/ch08.html I think you are hinting at what the author says in the first paragraph of that chapter: "In all of XML, I have found nothing quite so hard to understand yet easy to do as writing SAX filters."
|
 |
 |
|
|
subject: Adding attributes to root tag
|
|
|