Your input stream has to lie and say the source ended, but keep up with the
fact that there is more and then start providing the next document on the
next parse call. You cannot parse multiple documents in one parse call, but
if you keep calling parse and the input stream keeps feeding it document
chunks, the parser doesn't know or care that it came from the same source as
a long stream or not.

-------------------------------------
Dean Roddey
The Charmed Quark Controller
[EMAIL PROTECTED]
www.charmedquark.com
 


-----Original Message-----
From: afarah [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 02, 2003 2:32 PM
To: [EMAIL PROTECTED]
Subject: parse multiple documents from stream....


I want to parse multiple documents from a socket stream. The xercesc
SAXParser issues a "fatalError" when it finds anything past the end of the
first root node in its buffer.

I have written an extension to BinInputStream to use a socket. This stream
does a non-blocking "recv" and simply returns 0 when the "recv" thinks there
is no data to read. The SAXParser is happy with this unless my
BinInputStream returns more than one document in the "readBytes" call.

Is there a way to tell the parser to either a) parse multiple documents
inside the same buffer from a "readBytes" call or b) to tolerate multiple
root nodes and just plow ahead?

thanks.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to