Does anybody have any code samples where I can read an extremely big XML file using strictly SAX and store each of the element values into a vector or preferably an ArrayList? Later I would like to iterate through this vector/list from main or some other class.
There is nothing magic about SAX that prevents you from using standard Java techniques. You just have to adjust to the "callback" style of event processing.
You have to write a custom startElement method in your custom handler class - in that method, select the data you want to keep and store it in an ArrayList that is an instance variable of your custom handler class. When you get the endDocument event, you know the complete document has been processed and your ArrayList has all the data. You can do further processing in the handler or with the Thread that called the parser. Bill
subject: How to store values in a ArrayList from startElement?