[XML-SIG] DOM Extension Proposal
Dieter Maurer
dieter@handshake.de
Fri, 23 Jun 2000 20:11:31 +0200 (CEST)
Mike Olson writes:
> Paul Prescod wrote:
> >
> > Insofar as the DOM does not address Python's syntax overloading, it does
> > not say what we must do in our overloading.
> >
> > I propose that we extend the DOM with a new type AttributeList that is a
> > subclass of NamedNodeMap:
> >
> > It would override __getitem__ to return the *value* of the reference
> > attribute node instead of a (often useless and annoying) attribute node
> > object.
>
> 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?
It will break some code.
However, Unicode handling will in any case require some changes to
existing code. Therefore, this is a good time to make any
changes that seems to be worth.
I would like to stress, however, that all DOM specified functions
and attributes should behave as specified in DOM.
In our case: while "attributes[name]" may well return
the attribute's value, the DOM functions "item" and "getNamedItem"
should of cause return "Node".
Dieter