That's pretty much exactly much what I was looking for :-)
Rather than separate threads, I was hoping for something that monitored
the state of the internal buffer during the OutputStream.write() calls,
and fired off the appropriate ContentHandler methods when it had
received enough data to form a valid call, blocking the write until the
event returned - like once a "<" character is seen, monitor the input
until the corresponding ">" character is found and then fire the
handler's startElement(...) method.
It's obviously going to be quite a bit more involved that this, which
is why I was hoping someone had already written it, but the basic idea
seems like it ought to work.
I'm sure such out-to-in stream adapters are available as an
off-the-shelf item; do a bit of websearching.
So was I, so I did :-)
There's a bunch of generic stream adapters, but I couldn't find
anything which actually parsed the input stream into XML. I know
there's a bunch of projects that must do this (Cocoon springs to mind),
but I didn't find any likely candidate classes. Posting here was the
next step in my web searching.
If I don;t find anything then I may have a go at writing one, there's
plenty of parser code out there to base it on.
Cheers,
Barney
--
baarney
------------------------------------------------------------------------
baarney's Profile:
http://techiegroups.com/member.php?userid=84
View this thread:
http://www.techiegroups.com/showthread.php?t=105008