[XML-SIG] Attribute namespace bug
Juergen Hermann
Juergen Hermann" <jh@web.de
Tue, 30 Oct 2001 21:53:44 +0100
On Tue, 30 Oct 2001 13:37:53 -0700, Uche Ogbuji wrote:
>Whoa! I'm way behind, and still catching up, but I hope someone stoppe=
d you
>from committing this. You would have introduced a bug because unqualif=
ied
>attributes are *not* in the default namespace.
Too late. ;)
> for (name, value) in attrs.items():
> - name =3D self._current_context[name[0]] + ":" + name[1]
> + if name[0] is None:
> + name =3D name[1]
> + elif self._current_context[name[0]] is None:
> + # default namespace
> + name =3D name[1]
> + else:
> + name =3D self._current_context[name[0]] + ":" + name[=
1]
> self._out.write(' %s=3D"%s"' % (name, escape(value)))
But do you agree that it is wrong to always try to echo a namespace pref=
ix,
even if an attribute originally has none?
Maybe just my comment is wrong (s/# default namespace/# no namespace/), =
or the
elif is wrong, but the assumption that "self._current_context.has_key(No=
ne)" is
always true is also wrong.
Ciao, J=FCrgen