[XML-SIG] c14n attribute ordering problem?

Keith Beattie KSBeattie at lbl.gov
Tue Oct 7 21:52:31 EDT 2003


Rich Salz wrote:
> The Python code (which I now think is wrong, not libxml/xmlsec) is:
>     def _sorter_ns(n1,n2):
>         '''_sorter_ns((n,v),(n,v)) -> int
>         "(an empty namespace URI is lexicographically least)."'''
> 
>         if n1[0] == 'xmlns': return -1
>         if n2[0] == 'xmlns': return 1
>         return cmp(n1[0], n2[0])
> 
> Should that cmp be using [1] instead of [0]?

So I've taken a walk through c14n.py and that code isn't getting called 
by my counter-example (of the c14n'ing the sub-node).  It looks like 
_sorter (rather than _sorter_ns, which will do the right thing) is being 
used for sorting those inherited NS attrs at line 324.

I'm still digging at how to fix that, but should I submit a new bug at 
http://sourceforge.net/projects/pyxml/ ?  (I just created an account but 
otherwise I'm a newbie when it comes to contributing to SF projects). 
If so, I assume it would be under the DOM category?

Thanks,
ksb




More information about the XML-SIG mailing list