Re: [gdome] add listeners field to libxml tree.h?



> We need to implement event listeners pretty soon in Gdome. The easiest
> thing to do is to add a "listeners" field to every major node struct
> in libxml's trees.
  I guess it's Ok, the goal is to reflect as closely as possible the
"simple" data structures suggested by DOM. And the event stuff being
closely related to the elements in the tree, yes I think it makes sense.

> If this is voted to be not a good idea, then the next best choice is
> probably to implement a hashtable mapping nodes to listeners. This is
> actually more memory efficient, but otoh adds quite a bit of overhead
> to mutations -- you have to walk up the tree to the root, doing a
> hashtable lookup for each node.

  Basicallly my take is that DOM is inherently memory costly since
 it's targetted at editing the document. If people really wants memory
 efficiency, using the SAX interfaces are the way to go.

 Daniel

-- 
	    [Yes, I have moved back to France !]
Daniel Veillard w3 org | W3C, INRIA Rhone-Alpes  | Today's Bookmarks :
Tel : +33 476 615 257  | 655, avenue de l'Europe | Linux, WWW, rpmfind,
Fax : +33 476 615 207  | 38330 Montbonnot FRANCE | rpm2html, XML,
http://www.w3.org/People/W3Cpeople.html#Veillard | badminton, and Kaffe.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]