axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James M Snell" <jasn...@us.ibm.com>
Subject Xerces Pull Parser Interface
Date Sat, 24 Mar 2001 21:16:24 GMT
Ok,

I've been doing some experimentation with the Xerces Pull Parser 
interface.  It's pretty interesting and we could probably use it but we'd 
have a lot of the same problems with it that we would have if we went with 
just Sax.  The reason for that is that the "Pull-Parser" is pretty much 
nothing more than a Sax Parser that pauses between each XML element it 
finds. 

With Sax, you basically do: 

        SomeSAXParser sax = new SomeSaxParser(input_xml, content_handler);
        sax.parse();

In which case the "parse" method rips through the XML doc firing off 
events on the content_handler for each of the individual parts of the 
document.

With the Xerces pull parser, to do the same thing, you would do:

        SomePullParser pull = new SomePullParser(input_xml, 
content_handler);
        while (sax.parseSome()) {}

The parseSome method scans the XML document until it hits some significant 
item (like an element) and it fires off the appropriate event to the 
content_handler and stops until you call the parseSome method again.

I'm looking into how this can be used for the Axis Message API.  Any and 
all feedback would be appreciated.

- James Snell
     Software Engineer, Emerging Technologies, IBM
     jasnell@us.ibm.com (online)
     jsnell@lemoorenet.com (offline)

Mime
View raw message