Hi,

kesh...@us.ibm.com ha scritto:
My solution would be to tell the parser to read from an in-memory stream acting as a FIFO buffer, and run it in its own thread; then push data into that stream from the communications thread as it becomes available.
yes, this was also my first idea and, if I don't find any other solution, I'll probably go for it. I'm wandering if there is a way to invoke a parser on a piece of a xml document and not the entire document, each time a new piece is available. I think somewhere in the parser code there should be a loop and inside it a read on the InputStream that reads a char or a buffer of chars and does something on it. so in a way my aim is to directly invoke this procedure once I have a chunk of chars. in other words the read() should be non blocking and the parser should keep it status between a call and the other.

Of course the hard thing is going to be carrying this handshaking through to the application consuming the data, if it isn't driven completely by the SAX stream; you may need to design an in-memory document model that can be built incrementally and knows how to wait for more parsing if the requested subtree hasn't yet arrived. We did something along those lines for incremental DTM construction in Xalan, though there it was a matter of the model wanting to control the parser rather than vice versa.
interesting. can you tell me a little bit more on how the parser should work? I'm not sure I've understood.
thank you very much
mt


______________________________________
"... Three things see no end: A loop with exit code done wrong,
A semaphore untested, And the change that comes along. ..."
-- "Threes" Rev 1.1 - Duane Elms / Leslie Fish (http://www.ovff.org/pegasus/songs/threes-rev-11.html)


--
Marco Testa

Funambol :: Open Source Mobile'We' for the Mass Market :: 
http://www.funambol.com
Funambol :: Cross-Platform Mobile Open Source :: https://www.forge.funambol.org/



---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org
For additional commands, e-mail: j-users-h...@xerces.apache.org

Reply via email to