Murphy, James writes:
 > I think you are running into a socket programming issue more than anything
 > else.  I would set a flag in BinSockInputStream that gets signaled when you
 > get a short buffer.  If you ask for 1024 bytes and get 73 set the flag.
 > Check the flag on the way into readBytes to see if you are done or not.  
 > 
 > Otherwise you require some kind of transfer encoding scheme to tell when you
 > are done with the XML payload.  You may actually want ot look at
 > chunked-transfer-encoding...
 > 
 > Jim
 > 

Hi,

actually, this socket stuff works fine (BinSockInputStream also has a
backlog for data which it received but which actually belongs to the
next XML "file").  My problem would be the same if I would try to
parse from memory but have two XML "files" in this memory separated by
Ctrl-L (or any other encoding which allows to seperate "files" in the
stream.  Using a seperator char allows to fill the stream without
knowing the "file" size upfront).

My real problem is to decide when to proceed to the next "file" in my
stream.  The parser just calls readBytes a couple of times and assumes
that it always gets back 0 bytes at the end of the current "file".
(Which actually works fine if you only have one "file" in your
stream).  The only way to know how often to return 0 instead of
retuning the next "file" is by reading the Xeerces source code.

Actually, things are getting worse: readBytes is called from
XMLScanner::scanReset (as part of creating the XMLReader), then from
XMLScanner::scanProlog,  and then optionally from
XMLScanner::scanMiscellaneous.   So I don't even know how often to
return 0 (once or twice).

The call to XMLScanner::scanMiscellaneous is only done if the
XMLReader::fnoMore is false.  However, there is currently (read: in
Xerces-1.4) no place where this flag is ever set to true.

Being highly confused....

--nk


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

Reply via email to