[Expat-discuss] Pull parsing with Expat?

Karl Waclawek karl at waclawek.net
Sat Nov 4 15:35:54 CET 2006


Jonathan Claggett wrote:
> Hello,
>
> I'm looking to use Expat for parsing XML files (because it's fast and
> competent) but not via the standard callbacks. Instead, I want to loop
> through an input file by repeatedly calling an Expat function that returns
> the next XML token and its type from the input file. Ideally, there would be
> an XML_ParseNextToken() (or maybe the XmlTok macros?) function or something
> like that. I believe this kind of processing is known as 'pull' parsing
> since the application explicitly requests the next token to be handled.
> Anyway, is this kind of usage something Expat is suited for or can even
> handle?
>
>   
Not directly. You would have to write a Pull layer with internal
call-back handlers on top of Expat using XML_ParserStop in each handler.

Karl


More information about the Expat-discuss mailing list