> As a relative newcomer to the SAX and XML world, I am interested in > others' approaches to designing Servlet->Parser applications. > I also have a few specific questions about how SAX parsers work. > > An xml file is sent to our servlet via a multi-part http post. Because SAX > uses an InputSource and an InputSource uses an InputStream, I have written > an XmlInputStream (extends InputStream). The purpose of this input stream > is to filter out all of the http "stuff" from the xml document. It also > validates that the document sent is indeed an xml document, etc. So, as > the SAX parser reads from the InputSource, my XmlInputStream in turn > "reads" from teh original ServletInputStream - filtering along the way. I > guess i am wondering if this is what most people do or if there are other, > better/ more efficient approaches. > > As I was testing, I noticed that the SAX parser (Xerces) actually reads > the entire xml document before firing off events. I then tested with a > much, much larger file (3MB) and the parser would read for awhile, fire > events for awhile, read for awhile, ..... > Does anyone know how much the parser reads in each time, or how the > implementation was done to that end? > > thanks, > laura