You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Gary Beaver <ga...@responsys.com> on 2000/09/29 02:20:07 UTC

SAX callback behavior in Xerces 1.03 -- Don't want to wait for buffer to fill.

Hi,

We're trying to use the callback mechanism in SAX to execute code in
real-time. In our case, our implementation of ContentHandler.endElement
performs an action when an ending tag is read from an input source. The
behavior we're seeing is that the parser reads a chunk of characters before
invoking the callbacks. From looking at the source code, it appears that SAX
reads 16K or EOF before actually parsing the character input.

Is there any way to tell SAX to invoke callbacks when when it has read
enough characters to invoke a callback and not at some chunk boundary? If
not, will future versions of Xerces/SAX offer any support in this regard?

We're using the SAX parser in Xerces 1.03, running under JDK1.3.

-- Gary Beaver



Re: SAX callback behavior in Xerces 1.03 -- Don't want to wait for buffer to fill.

Posted by Peter Johnson <pe...@kbdnet.net.au>.
Gary,

See the FAQ "How do I read data from a stream as it arrives?". That should
solve your problem.

regards
Peter Johnson

----- Original Message -----
From: "Gary Beaver" <ga...@responsys.com>
To: <xe...@xml.apache.org>
Cc: "Bart Locanthi" <ba...@sabl.com>; <be...@electronhead.com>
Sent: Friday, September 29, 2000 10:20 AM
Subject: SAX callback behavior in Xerces 1.03 -- Don't want to wait for
buffer to fill.


> Hi,
>
> We're trying to use the callback mechanism in SAX to execute code in
> real-time. In our case, our implementation of ContentHandler.endElement
> performs an action when an ending tag is read from an input source. The
> behavior we're seeing is that the parser reads a chunk of characters
before
> invoking the callbacks. From looking at the source code, it appears that
SAX
> reads 16K or EOF before actually parsing the character input.
>
> Is there any way to tell SAX to invoke callbacks when when it has read
> enough characters to invoke a callback and not at some chunk boundary? If
> not, will future versions of Xerces/SAX offer any support in this regard?
>
> We're using the SAX parser in Xerces 1.03, running under JDK1.3.
>
> -- Gary Beaver
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
>