[XML-SIG] patch to xml/dom/esis_builder.py
Fred L. Drake
Fred L. Drake, Jr." <email@example.com
Tue, 1 Jun 1999 14:37:38 -0400 (EDT)
J.R. van Ossenbruggen writes:
> I include the relevant patch below. I think the changes could be
> useful for more people, and as far as I know,do not break any existing
> code. I'd be grateful if they are included in the main distribution.
I like this, but have two changes. First, the default convert
function could be str instead of a lambda; this would be faster since
str() is implemented in C (or Java in JPython).
The second change concerns this part of the patch:
> ! name = self.convert(l)
> ! if l == 'IMPLIED':
> ! # fix this. Needs to be undefined attr
> ! value = ''
> ! else:
> ! value = ESISDecode(l)
> self.attr_store[name] = value
This could be something like this:
if l != 'IMPLIED':
self.attr_store[self.convert(l)] = ESISDecode(l)
This does just as much as needed, and doesn't create the bogus
attribute entry in the dictionary.
Fred L. Drake, Jr. <firstname.lastname@example.org>
Corporation for National Research Initiatives