[XML-SIG] DOM Extension Proposal
Lars Marius Garshol
22 Jun 2000 10:23:11 +0200
* 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.