SAX and Threads and Rock'n'roll

October 29, 2002 6:47 PM

Can anyone help me with a Java/XML parsing problem?

The way the SAXParser works, is it sits around blocking on an InputStream. This isn't a particularly good match for non-blocking IO, as you end up wasting a thread for each stream you're parsing. What I'd like is a SAX parser that works the other way round, by letting me push the raw data into it, chunk by chunk.

Does such a beast already exist? Am I missing something in the standard API that I wouldn't be if I'd got more sleep last night? If not, I expect it'd be easy for me to hack Xerces to work the way I want it to, but I dislike reinventing the wheel.

Previously: Idle Musing

Next: XML Pulling