[XML-SIG] dom implementations

Mike Olson Mike.Olson@fourthought.com
Tue, 30 Jan 2001 10:45:37 -0700


Uche Ogbuji wrote:
> 
> > > It is tempting to look into ways of not having to pay this huge
> > > penalty when you don't use that feature.  I've come across similar
> > > problems many times when doing Python programming and wish there were
> > > a general solution.
> >
> > I thought about this when I added Events to 4DOM, and finally did not
> > implement a way to disable them, because I was a bit in a hurry at that
> > time.
> >
> > I now see two solutions possible solutions:
> >
> >  * have the Document instance be aware of existing listeners, and let the
> > propagation methods query the document before actually propagating
> > anything (this would completely disable Event propagation if noone is
> > listening)
> 

Or make the document the hub, all events go through the document and
either it propogates or it doesn't.  I don't think there is much
overhead in the actual sending of an event.  

Another though I had was to be able to turn events on and off at
runtime.  Ex, when you read in a document you don't want all of the
events, but after it is read you may...


> >  * use the the hasFeature method of the DOM implementation to see if we
> > want DOM L3 events (a bit as is done in the 4DOM test suite where
> > namespaces are disabled at some point), and let the propagatoin know if it
> > is expected to propagate anything.


Yes, except instead of haveing the code spread all over have a
_4dom_propogate on the document that is a noop if the feature is not
enabled.


I'd like the same type of setup for Ranges as well, but I'll wait until
we agree on something before I implement....

Mike

> 
> _______________________________________________
> XML-SIG maillist  -  XML-SIG@python.org
> http://mail.python.org/mailman/listinfo/xml-sig

-- 
Mike Olson				 Principal Consultant
mike.olson@fourthought.com               (303)583-9900 x 102
Fourthought, Inc.                         http://Fourthought.com 
Software-engineering, knowledge-management, XML, CORBA, Linux, Python