[XML-SIG] Attribute namespace bug

Uche Ogbuji uche.ogbuji@fourthought.com
Tue, 30 Oct 2001 13:37:53 -0700


> Hi!
> 
> This fixes the bug I found, can I commit it?
> 
> Index: saxutils.py
> ===================================================================
> RCS file: /cvsroot/pyxml/xml/xml/sax/saxutils.py,v
> retrieving revision 1.20
> diff -u -r1.20 saxutils.py
> --- saxutils.py 2001/07/19 16:15:44     1.20
> +++ saxutils.py 2001/08/31 18:40:09
> @@ -205,7 +205,13 @@
>          self._undeclared_ns_maps = []
> 
>          for (name, value) in attrs.items():
> -            name = self._current_context[name[0]] + ":" + name[1]
> +            if name[0] is None:
> +                name = name[1]
> +            elif self._current_context[name[0]] is None:
> +                # default namespace
> +                name = name[1]
> +            else:
> +                name = self._current_context[name[0]] + ":" + name[1]
>              self._out.write(' %s="%s"' % (name, escape(value)))
>          self._out.write('>')

Whoa!  I'm way behind, and still catching up, but I hope someone stopped you 
from committing this.  You would have introduced a bug because unqualified 
attributes are *not* in the default namespace.


-- 
Uche Ogbuji                               Principal Consultant
uche.ogbuji@fourthought.com               +1 303 583 9900 x 101
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St, Boulder, CO 80301-2537, USA
XML strategy, XML tools (http://4Suite.org), knowledge management