[XML-SIG] DOM Extension Proposal
Uche Ogbuji
uogbuji@fourthought.com
Sun, 25 Jun 2000 09:19:36 -0600
>
> * Mike Olson
> |
> | We inherit NamedNodeMap from UserDict now so we are not too far off.
> | However, we do return the Attribute node. I suppose we could override
> | this to return just the value of the node.
> |
> | Anyone else's thoughts?
>
> I have been wondering why we even have Attribute nodes in the DOM tree
> at all. They are mainly useful for representing entity references in
> attribute values, something that is very rarely useful. :-)
>
> So I think there would be definite performance benefits (in terms of
> both speed and memory use) in keeping a dictionary of names -> string
> values instead of names -> nodes.
>
> Attribute nodes could be lazily instantiated when someone calls
> getAttributeNode. If we want to support entity references inside
> attributes we can do this by using lists in the dictionary for those
> cases instead of strings. Most likely this would be used in much less
> than 1% of the cases and I wouldn't complain if we decided not to
> support this stuff at all.
This is exactly an optimization we have in mind for 4DOM 1.0, inspired by a
similar enhancement in Xalan's DOM.
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +01 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