xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: How to start writing a non-blocking SAX parser
Date Fri, 26 Apr 2002 12:25:11 GMT
Miguel A Paraz wrote:
> Hi,
> I am looking at writing a parser or building on existing code to 
> make the change that the parse() method will not block. 
> If no input is available, it should return immediately and inform the caller,
> by returning boolean false, for instnace.
> This is for parsing XML data that is coming through a stream, but should not
> wait on its input source (InputSource?), like by checking Reader.ready().
> Are there existing parsers that do this, or, what code do you recommend I 
> use as a base?  I'd like to use Crimson for simplicity and small size, but
> is it already being phased out in favor of Xerces?
> Thanks!

The idea of a non blocking parser does have appeal, however there are
things we have to consider:

1) Use-Case:  A Non-blocking parser is used to kick off an XML stream to
    another location.  IOW, we are not using the results of the stream in
    this process.

2) Ease of implementation:  We can get the affect of a non-blocking
    parser by running the parse in a background thread.  If we need DOM,
    we use the concept of a Future (starts processing immediately in
    another thread, and only blocks on the first call to the object).
    SAX can be kicked off and left alone.

Keep in mind that some things like SAX and JAXP have standard interfaces
that we simply cannot change.


"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin

In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org

View raw message