<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
  <title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Well, this is great. However, example 3.3 [1] from the same
specification <br>
shows a different sorting (look at element &lt;e5/&gt;). And after
fixing this in libxml2<br>
I have a lot of interop tests failures in both C14N and XMLDSig.<br>
<br>
Aleksey<br>
<br>
[1] <a class="moz-txt-link-freetext" href="http://www.w3.org/TR/xml-c14n#Example-SETags">http://www.w3.org/TR/xml-c14n#Example-SETags</a><br>
<br>
Rich Salz wrote:<br>
<blockquote type="cite"
 cite="midPine.LNX.4.44L0.0309302130120.11459-100000@smtp.datapower.com">
  <blockquote type="cite">
    <pre wrap=""># What I expect:
$ python2.3 c14n_test.py
&lt;dsig:SignedInfo xmlns="urn:envelope" xmlns:dsig=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2000/09/xmldsig#">"http://www.w3.org/2000/09/xmldsig#"</a>&gt;&lt;/dsig:SignedInfo&gt;
# What I get:
$ python2.3 c14n_test.py
&lt;dsig:SignedInfo xmlns:dsig=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2000/09/xmldsig#">"http://www.w3.org/2000/09/xmldsig#"</a> xmlns="urn:envelope"&gt;&lt;/dsig:SignedInfo&gt;
    </pre>
  </blockquote>
  <pre wrap=""><!---->
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

Sorry, Aleksey, looks like a bug. :)  (That's actually a rueful smile;
Aleksey and I have commiserated over the pain in the a-- that is XML
c14n and exc-c14n.)
        /r$
--
Rich Salz                  Chief Security Architect
DataPower Technology       <a class="moz-txt-link-freetext" href="http://www.datapower.com">http://www.datapower.com</a>
XS40 XML Security Gateway  <a class="moz-txt-link-freetext" href="http://www.datapower.com/products/xs40.html">http://www.datapower.com/products/xs40.html</a>
XML Security Overview      <a class="moz-txt-link-freetext" href="http://www.datapower.com/xmldev/xmlsecurity.html">http://www.datapower.com/xmldev/xmlsecurity.html</a>
  </pre>
</blockquote>
</body>
</html>