|XML Parsers (Push and Pull) email@example.com (2002-01-18)|
|Re: XML Parsers (Push and Pull) firstname.lastname@example.org (Bill Rayer) (2002-01-24)|
|Re: XML Parsers (Push and Pull) RLWatkins@CompuServe.Com (R. L. Watkins) (2002-01-24)|
|Re: XML Parsers (Push and Pull) email@example.com (2002-01-28)|
|Re: XML Parsers (Push and Pull) firstname.lastname@example.org (2002-01-28)|
|Re: XML Parsers (Push and Pull) email@example.com (2002-02-06)|
|Re: XML Parsers (Push and Pull) firstname.lastname@example.org (2002-02-16)|
|Re: XML Parsers (Push and Pull) email@example.com (2002-02-28)|
|From:||firstname.lastname@example.org (Alex Colvin)|
|Date:||28 Jan 2002 01:10:19 -0500|
|Organization:||The World Public Access UNIX, Brookline, MA|
|Posted-Date:||28 Jan 2002 01:10:19 EST|
> There are two main ways to parse XML, push which is event driven, and
> pull which is in memory. All material and documentation that I've
> read states that these are the two major ways of parsing XML, never
> does it state that these are the only ways.
Those are two major ways. But, since you ask, we can make up other ways.
For example, you could "push" input at the parser, but instead of having
it call out when there's an event, you would call the parser asking if it
had any event ready. This is a bit like polled I/O, instead of
More tricky, you could have a coroutine or pipe interface for the input or
the events or both, where each side believes it is calling the other. The
input process pushes characters at the parser, but the parser calls for
more input. Likewise, the parser calls out with events, but the rest of
the program calls the parser to get an event. Each call blocks until the
other side pushes it something.
The first approach leads to a parser state machine, the second to
processes. Neither is particularly interesting. Each structure can be
simulated by the others.
For good measure, there's the table-look-up approach, which simply
matches the input against a table and returns the corresponding structure.
mac the naïf
Return to the
Search the comp.compilers archives again.