On Mon, 25 Oct 2004 14:40:34 -0400, Joseph Kesselman wrote: > > There is limited pull support already in Xerces if you work at the XNI > level. (Actually, it's closer to "burst push".) > > My solution when I needed a true event-by-event pull parser was to wrap the > SAX invocations in a coroutine-based "throttle" -- run the parser and app > in different threads and use some inter-thread handshaking to pause one > while the other was running and vice versa. I believe that code is checked > into the Xalan project, if you want to try adapting it to your own needs; > see the CoroutineManager and CoroutineParser classes.
Another option that avoids multithreading is to implement a pull API on top of the SAX "burst push", using the SAX callbacks to buffer the pull events. Each call into the pull API either returns a buffered event or, if there are no buffered events, lets the SAX parser run for another "burst". This seems pretty feasible with a pull API such as the StAX event API (it could be made to work with the StAX cursor API too but some of the advantages of using the cursor API would probably be lost). Long term, is there any plan to implement StAX support in Xerces (either as I've described, on top of burst SAX, or at a lower level)? Anybody have any opinions in general about StAX? -Steve --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]