Return-Path: Delivered-To: apmail-xml-general-archive@xml.apache.org Received: (qmail 67112 invoked by uid 500); 30 Apr 2002 21:30:46 -0000 Mailing-List: contact general-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: general@xml.apache.org Delivered-To: mailing list general@xml.apache.org Received: (qmail 67024 invoked from network); 30 Apr 2002 21:30:45 -0000 Message-ID: <3CCF0D04.6E54CE39@cs.indiana.edu> Date: Tue, 30 Apr 2002 16:30:44 -0500 From: Aleksander Slominski X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: general@xml.apache.org Subject: Re: How to start writing a non-blocking SAX parser References: <20020428171539.B1181@localhost.localdomain> <20020428131557.W642-100000@fenris.webthing.com> <20020428221248.C1181@localhost.localdomain> <3CCC1471.A72DC2F9@cs.indiana.edu> <3CCC9A9F.4A666D7D@apache.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Andy Clark wrote: > > this function will deliver one callback and return (true > > indicates that more input is availabel, false is returned > > when parsing is finished). > > A parser configuration implementing the XMLPullParserConfiguration > interface does not guarantee that one callback will be performed > for each call to parse(false). In fact, the number of callbacks > can be zero, one, or more. The only thing that it guarantees is > that the parser configuration can break at "reasonable" places > during parsing and return control back to the application. that is one of reason why standardization of doing XML pull parsing is important. > The reason that a single callback is not guaranteed is due to the > pipeline nature of the parser configuration. The configuration is > made up of a series of components and these components may add or > remove events in the pipeline. So even if the scanner produces > only one callback, that callback may turn into multiple callbacks > as it moves through the pipeline. For example: the namespace > binding component receives a startElement event and may produce > any number of startPrefixMapping events in addition to passing > along the startElement event. > > However, it's certainly possible that a configuration can be > written that guarantees one and only one callback. It's just > that one hasn't been written, yet. > > I haven't looked into your XPP2 implementation on top of XNI > so I don't know how you ensure that only one callback gets > propagated back to the application. Depending on the information > that you return this is certainly possible for the standard case > but there may be other parser configuration where the simple > approach breaks down. it gathers information from callback(s) to return to the user just one event. if XNI parse(false) were too many callbacks the xni2xmlpull parser should throw exception (it is _not_ tested ...) > I have reservations about mixing the API approaches. But that's > not to say it can't work for all XNI pull-parsing configurations > and that there's no value in such an attempt. It might even be > fun to try. :) you can try an old version that i wrote for XPP2 to use XNI pull parsing, for example look on: http://www.extreme.indiana.edu/xgws/xsoap/xpp/download/PullParser2/src/java/x2/ i have also started xni2xmlpull project at sourceforge.net to implement XMLPULL V1 API (http://www.xmlpull.org) using Xerces2 - the project is under Apache license. i would be very interested in making xni2xmlpull into sub-project of Xerces2 as it would allow users of Xerces 2 to access and use simple XMLPULL API. my implementation (alpha) is very small and together with XMLPULL API classes its jar file should be about 20K addition to Xerces2 jar. however i do not know what is the current procedure to create sub project? thanks, alek --------------------------------------------------------------------- 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