[XML-SIG] Child nodes and lazy evaluation (Generators)

uche.ogbuji@fourthought.com uche.ogbuji@fourthought.com
Thu, 23 Nov 2000 10:57:59 -0700


> This sounds like an excellent utility for a "pull DOM parser", where
> you receive DOM events as you ask for them, out of a queue.  In a
> basic "pull DOM parser" though, no real magic is necessary as long as
> you have an incremental parser feeding the DOM builder.
> 
> James Clark's Jade DSSSL processor uses a similar technique for
> manipulating partial groves.  Jade had the ability to be parsing the
> source file and doing the transform in parallel, if any node requested
> was not yet parsed, the node request would block until the parser
> thread caught up.

Yes.  If Python gets coroutines, this would be pretty simple to implement as 
well.  As I've mentioned on the 4Suite lists, if some of the facilities from 
Stackless were to move into cpython (which seems likely), a _lot_ of 
sophistication will become available for XML processing patterns that I think 
would put us way ahead of Java, Perl, etc.

-- 
Uche Ogbuji                               Principal Consultant
uche.ogbuji@fourthought.com               +1 303 583 9900 x 101
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python