Re: XML Parsers (Push and Pull)

alexc@world.std.com (Alex Colvin)
28 Jan 2002 01:10:19 -0500

          From comp.compilers

Related articles
XML Parsers (Push and Pull) isterin@hotmail.com (2002-01-18)
Re: XML Parsers (Push and Pull) william.rayer@virgin.net (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) isterin@hotmail.com (2002-01-28)
Re: XML Parsers (Push and Pull) alexc@world.std.com (2002-01-28)
Re: XML Parsers (Push and Pull) rkrayhawk@aol.com (2002-02-06)
Re: XML Parsers (Push and Pull) marcus@tuells.org (2002-02-16)
Re: XML Parsers (Push and Pull) rkrayhawk@aol.com (2002-02-28)
| List of all articles for this month |

From: alexc@world.std.com (Alex Colvin)
Newsgroups: comp.compilers
Date: 28 Jan 2002 01:10:19 -0500
Organization: The World Public Access UNIX, Brookline, MA
References: 02-01-085 02-01-124
Keywords: parse, XML
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
interrupt-driven I/O.


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 naf


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.