[XML-SIG] pyDOM NamedNodeMap - bug report and problem

Dieter Maurer dieter@handshake.de
Fri, 13 Aug 1999 08:41:24 +0200 (CEST)


Hello Sean

Sean Mc Grath writes:
 > After fix: (parenthesis in call to values method of data dictionary)
 >     # Additional methods specified in the DOM Recommendation
 >     def item(self, index):
 >         return self.data.values()[ index ]
 > 
 > I am now getting my attribute names through just fine but all my attribute
 > values are None. There are definitely there in the DOM structure because
 > toxml puts 'em out just fine. Ideas?
For some unknown reason (a bug, I think),
the real attribute information is in the "children[0]" attribute
of the returned "item".

You may try:
 >     def item(self, index):
 >         return self.data.values()[ index ].children[0]

But I am not sure, whether this will work for all NamedNodeMap's.
And it is probably not the correct solution, because it returns
a "_nodeData" instance rather than an "Attr" instance.

Almost surely, the correct implementation is:
 >     def item(self, index):
 >         return Attr(self.data.values()[ index ],self._document)

- Dieter