[XML-SIG] patch to xml/dom/esis_builder.py

Fred L. Drake Fred L. Drake, Jr." <fdrake@acm.org
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[0])
 > !                 if l[1] == 'IMPLIED':
 > !                     # fix this. Needs to be undefined attr
 > !                     value = ''
 > !                 else:
 > !                     value = ESISDecode(l[2])
 >                   self.attr_store[name] = value

  This could be something like this:

	if l[1] != 'IMPLIED':
	    self.attr_store[self.convert(l[0])] = ESISDecode(l[2])

This does just as much as needed, and doesn't create the bogus
attribute entry in the dictionary.


  -Fred

--
Fred L. Drake, Jr.	     <fdrake@acm.org>
Corporation for National Research Initiatives