So you have to work with multiple XML files simultaneously that contain data related to each other, and you need the capability to not only read but write as well? Do you have to write to select parts of the existing file or are you going to be writing to a new file?
Given the format of the file and use of the data, would it be possible to increment it? I understand you haven't tried, but knowing what the data is, how the file is structured, and what you need to use it for should give you an idea of whether or not it's even logically viable in the first place.
The thing I would look at is whether or not you can create some helper classes and create your own data structure that does what you need, and then use the information from that to make changes to the file or write a new file. I'm currently working on a project involving XML in which the files are 'indefinately' large, I know for sure there will be files with more than 500,000 lines and I have to plan for 2,000,000 plus. SAX gives you access to just about anything you could want, find some way to store the data so that it meets your needs. For me, I could handle the data incrementally and as such I created my own "Element" class which simply represented an element and contained not only its data but all the information I would need to collect that data and to generate output, including its parent, attributes, children, and location within the file and simply stored it in a collection. When I'm done with that part of the XML I generate output, creating or appending the new XML file as needed.
I don't know what your situation calls for, parsing with SAX is a given, how you handle it from there is the question. If you can do it with DOM and that meets your needs then that's the ticket, but if it doesn't then realize that you don't have to use SAX or DOM to store, access, and manipulate the data, you can create your own way of doing that and simply use SAX to get the initial information. Look into using a locator as well,
you should be able to find the part of the file where the data you want to change is and change it.
Anyway, I hope something in this has provided some tidbit of aid. I know I had
alot of trouble finding a solution to my problem and I tried any number of designs. Nothing worked until I realized I was just going to have to do the work myself, including creating an algorithm to generate output. Surprisingly, it wasn't that difficult, so don't limit yourself.
EDIT: And you might take a look at JDOM. I haven't had a chance to look into it in-depth but based upon what other's have said it might just have the flexibility you need.
In fact, here's the quote:
SAX is read-only. Why don't you use JDOM, which only load data into memory when you need them, it can handle large files.
I had already solved my problem at the time and didn't have the time to look into it to see if it would work better (yet anyway) so I have no idea if it will work for you.
[ August 08, 2003: Message edited by: Ken Blair ]