[XML-SIG] Bug in sgmlop? (_ in names)

Walter Doerwald walter@livinglogic.de
Wed, 05 Jul 2000 17:49:46 +0200


At 18:10 23.06.00, you wrote:
>On Fri, Jun 23, 2000 at 02:00:26PM +0200, Walter Doerwald wrote:
> >I think I found a bug in sgmlop (from PyXML 0.5.5.1). It doesn't
> >recognize _ in element names. The following code:
>
>I believe this bug was fixed in the 2000/05/28 update of sgmlop, which
>is what's currently in the CVS tree.  (And recent releases of 0.5.x
>should have the updated version, therefore.)

I finally found the time to try it with the new version from
http://www.pythonware.com/products/xml/index.htm (sgmlop-000528.zip (Jun=20
28) (?))
and the bug is still there.

And I think I found a new one:

import sgmlop

class Handler:
    def finish_starttag(self,name,attrs):
       print name,attrs

p =3D sgmlop.SGMLParser()
p.register(Handler())
p.parse("<foo_bar bar baz/>")

results in

foo {'_bar' : '_bar', 'baz': '', 'bar': 'bar'}

So the attributes bar and baz seem to be treated differently.

If using XMLParser instead of SGMLParser, the result is:

foo_bar {'baz': '', 'bar': 'bar'}

Bye,
         Walter D=F6rwald

--
Walter D=F6rwald =B7 LivingLogic AG =B7 Bayreuth, Germany =B7 www.livinglogi=
c.de