[XML-SIG] c14n attribute ordering problem?

Keith Beattie KSBeattie at lbl.gov
Tue Sep 30 23:56:25 EDT 2003

Rich Salz wrote:
> The Python code is right; your expectation (and, apparently xmlsec)
> is wrong.  The default namespace declaration is treated as if the localname
> is "xmlns".  See the "Namespace Nodes" bullet in section 2.3

Then isn't the following wrong?

$ python2.3
Python 2.3 (#1, Aug 14 2003, 17:43:17) 
[GCC 3.2.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from xml.dom import minidom
>>> from xml.dom.ext import c14n
>>> print c14n.Canonicalize(minidom.parseString("<foo xmlns='baz' xmlns:a='bat'/>"))
<foo xmlns="baz" xmlns:a="bat"></foo>

Why isn't the xmlns="baz" treated as xmlns:xmlns="baz" here and sorted after the xmlns:a?


More information about the XML-SIG mailing list