OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] Push and Pull?

[ Lists Home | Date Index | Thread Index ]

I didn't say in necessarily meant in all memory representations, but rather
that pull refers to the parsers like (DOM) that load the data and make it
available to the program through a structure/interface, where push interface
gives you the flexibility of even handlers (SAX) interface.

Ilya

-----Original Message-----
From: Dare Obasanjo
To: Sterin, Ilya; ''Jeff Lowery' '; xml-dev@lists.xml.org
Sent: 11/25/01 12:43 PM
Subject: Re: [xml-dev] Push and Pull?

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.htm
l

--
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@ciber.com>
To: "'Dare Obasanjo '" <kpako@yahoo.com>; "''Jeff Lowery' '"
<jlowery@scenicsoft.com>; <xml-dev@lists.xml.org>
Sent: Friday, January 25, 2002 7:21 AM
Subject: RE: [xml-dev] 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@lists.xml.org
> Sent: 11/25/01 3:17 AM
> Subject: Re: [xml-dev] 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@ciber.com>
> To: "'Dare Obasanjo'" <kpako@yahoo.com>; "'Jeff Lowery'"
> <jlowery@scenicsoft.com>; <xml-dev@lists.xml.org>
> Sent: Friday, January 25, 2002 2:08 AM
> Subject: RE: [xml-dev] Push and Pull?
>
>
> >
> >
> > > -----Original Message-----
> > > From: Dare Obasanjo [mailto:kpako@yahoo.com]
> > > Sent: Sunday, November 25, 2001 1:45 AM
> > > To: Sterin, Ilya; 'Jeff Lowery'; xml-dev@lists.xml.org
> > > Subject: Re: [xml-dev] 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@ciber.com>
> > > To: "'Jeff Lowery'" <jlowery@scenicsoft.com>;
> <xml-dev@lists.xml.org>
> > > Sent: Friday, January 25, 2002 1:35 AM
> > > Subject: RE: [xml-dev] 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@scenicsoft.com]
> > > > > Sent: Wednesday, January 16, 2002 1:45 PM
> > > > > To: 'Sterin, Ilya'; xml-dev@lists.xml.org
> > > > > Subject: RE: [xml-dev] 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@ciber.com]
> > > > > > Sent: Tuesday, January 15, 2002 11:39 PM
> > > > > > To: xml-dev@lists.xml.org
> > > > > > Subject: [xml-dev] 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




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS