[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Push and Pull?


pull based model
No. The pull model has *nothing* to do with an in-memory representation of the
document. If you are confused about the pull model, a quick Google search[0]
will explain it to you. In fact from where I sit, throwing some XML into the
DOM and then manipulating the object model is _not_ parsing. Below is an
example of pull-based parsing taken from fawcette.com

XmlTextReader reader = new
      XmlTextReader(Server.MapPath("myfile.xml"));
while (reader.Read()) {
   if (reader.NodeType == XmlNodeType.Element) {
      Response.Write("Found an Element!<br />");
      if (reader.HasAttributes()) {
         while (reader.MoveToNextAttribute())  {
            Response.Write(
                  "&nbsp;&nbsp;Found an Attribute!<br />");
         }
      }
   }
}
// Make sure you close the stream to prevent file locking
reader.Close();

Note how it differs from push or event based processing in that you control
the flow of processing instead of passively waiting for callbacks from the
API.

What Jeff claimed to be "batch parsing" which is a term I disagree with since
no parsing is being done by the application developer but instead by the
internal DOM APIs is using a loadXML style method to load a string into the
DOM[2]. Or at least that's what it sounds like he is talking about.

[0] http://www.google.com/search?hl=en&q=pull+model+xml+
[1] http://www.fawcette.com/xmlmag/2001_11/magazine/departments/tips/
[2] http://www.devguru.com/Technologies/xmldom/quickref/document_loadXML.html

--
THINGS TO DO IF I BECOME AN EVIL OVERLORD #118
If I have equipment which performs an important function, it will not
be activated by a lever that someone could trigger by accidentally falling
on when fatally wounded.

----- Original Message -----
From: "Sterin, Ilya" <Isterin@c...>
To: "'Dare Obasanjo '" <kpako@y...>; "''Jeff Lowery' '"
<jlowery@s...>; <xml-dev@l...>
Sent: Friday, January 25, 2002 7:21 AM
Subject: RE:  Push and Pull?


> Correct, that's actually what I was refering too.  The pull model is refered
> to in memory parsing.  The parser creates an in memory representation (data
> structure) of the xml doc.
>
> Now, what I would like to know is the difference between that and what Jeff
> mentioned as a batch processing, which also creates an **in memory**
> representation of the doc?  DOM parsers are pull parsers.
>
> When you guys say it loads directly, what do you mean.  It doesn't use a
> traversal to load into DOM.
>
> Ilya
>
> -----Original Message-----
> From: Dare Obasanjo
> To: Sterin, Ilya; 'Jeff Lowery'; xml-dev@l...
> Sent: 11/25/01 3:17 AM
> Subject: Re:  Push and Pull?
>
> Errr, no.
>
> The pull model is that used by Microsoft .NET's XmlReader API[0] or
> XPP[1]. In
> the push model the API calls your methods as it sees parts of the XML
> stream
> while in the pull model you are in complete control of traversing the
> XML
> stream.
>
> One way of looking at it is that in the pull model, the big while loop
> that
> iterates through all the nodes in document is hidden from you while in
> pull
> model you're the one that writes it.
>
>
> [0]
> http://msdn.microsoft.com/library/en-us/cpguide/html/cpconreadingxmlwith
> xmlrea
> der.asp
> [1] http://www.extreme.indiana.edu/soap/xpp/
>
> --
> THINGS TO DO IF I BECOME AN EVIL OVERLORD #112
> I will not rely entirely upon "totally reliable" spells that can be
> neutralized by relatively inconspicuous talismans.
>
> ----- Original Message -----
> From: "Sterin, Ilya" <Isterin@c...>
> To: "'Dare Obasanjo'" <kpako@y...>; "'Jeff Lowery'"
> <jlowery@s...>; <xml-dev@l...>
> Sent: Friday, January 25, 2002 2:08 AM
> Subject: RE:  Push and Pull?
>
>
> >
> >
> > > -----Original Message-----
> > > From: Dare Obasanjo [mailto:kpako@y...]
> > > Sent: Sunday, November 25, 2001 1:45 AM
> > > To: Sterin, Ilya; 'Jeff Lowery'; xml-dev@l...
> > > Subject: Re:  Push and Pull?
> > >
> > >
> > > From where I sit they are very different. Batch parsing is
> > > loading an entire stream or string into the DOM in one step
> > > with a loadXML or similar method, then interacting with the
> > > XML from the DOM. Pull parsing is at the other end of the
> > > horizon where you iterate through every node in your document
> > > one-by-one (text, element, PI, comment, etc) and perform
> > > operations utilizing the ones you are interested in.
> >
> > You are actually refering to even driven parsing, which is the push
> > model.  The pull model loads the document in memory, so DOM parsers
> are
> > considered pull.
> >
> > Ilya
> >
> >
> > >
> > > At least that's what I gathered from the descriptions I've seen.
> YMMV.
> > >
> > > --
> > > THINGS TO DO IF I BECOME AN EVIL OVERLORD #112
> > > I will not rely entirely upon "totally reliable" spells that
> > > can be neutralized by relatively inconspicuous talismans.
> > >
> > > ----- Original Message -----
> > > From: "Sterin, Ilya" <Isterin@c...>
> > > To: "'Jeff Lowery'" <jlowery@s...>;
> <xml-dev@l...>
> > > Sent: Friday, January 25, 2002 1:35 AM
> > > Subject: RE:  Push and Pull?
> > >
> > >
> > > > Jeff, quick question, how would batch parsing differ from pull, I
> > > > would think it's the same concept?  Maybe I'm just not
> > > understanding
> > > > this correctly?
> > > >
> > > > Ilya
> > > >
> > > > > -----Original Message-----
> > > > > From: Jeff Lowery [mailto:jlowery@s...]
> > > > > Sent: Wednesday, January 16, 2002 1:45 PM
> > > > > To: 'Sterin, Ilya'; xml-dev@l...
> > > > > Subject: RE:  Push and Pull?
> > > > >
> > > > >
> > > > > A third is what I would call (for want of a better name) "batch"
> > > > > parsing, such as where a parser writes directly to a DOM.
> > > I believe
> > > > > there's a method in the W3C DOM to load a document directly; at
> > > > > least I know that some implementation support that feature.
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Sterin, Ilya [mailto:Isterin@c...]
> > > > > > Sent: Tuesday, January 15, 2002 11:39 PM
> > > > > > To: xml-dev@l...
> > > > > > Subject:  Push and Pull?
> > > > > >
> > > > > >
> > > > > > Push and Pull being the most popular ways of parsing XML,
> > > > > can someone
> > > > > > please list some alternatives, if any.  Most documentation
> > > > > says that
> > > > > > push and pull are two ways of parsing, though it never
> > > mentiones
> > > > > > if there are other ways as well.
> > > > > >
> > > > > > Thanks.
> > > > > >
> > > > > > Ilya
> > > > > >
> > > > > >
> > > -----------------------------------------------------------------
> > > > > > The xml-dev list is sponsored by XML.org
> > > <http://www.xml.org>, an
> > > > > > initiative of OASIS
> > > <http://www.oasis-open.org>
> > > > > >
> > > > > > The list archives are at
> http://lists.xml.org/archives/xml-dev/
> > > > > >
> > > > > > To subscribe or unsubscribe from this list use the
> subscription
> > > > > > manager: <http://lists.xml.org/ob/adm.pl>
> > > > > >
> > > > >
> > > >
> > > > -----------------------------------------------------------------
> > > > The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> > > > initiative of OASIS <http://www.oasis-open.org>
> > > >
> > > > The list archives are at http://lists.xml.org/archives/xml-dev/
> > > >
> > > > To subscribe or unsubscribe from this list use the subscription
> > > > manager: <http://lists.xml.org/ob/adm.pl>
> > >
> > >
> > > _________________________________________________________
> > > Do You Yahoo!?
> > > Get your free @yahoo.com address at http://mail.yahoo.com
> > >
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.