[XML-SIG] c14n.py bug: _IN_XML_NS = lambda n: n.namespaceURI == XMLNS.XML

Joseph Reagle reagle@w3.org
Thu, 23 Jan 2003 22:30:48 -0500

A bug is fixed if I comment out present line and include the subsequent:

# _IN_XML_NS = lambda n: n.namespaceURI == XMLNS.XML
_IN_XML_NS = lambda n: n.name[:5] == "xmlns"

_IN_XML_NS is used if an element is being inclusively canonicalized. (This 
is *not* a full dom tree being tested against a XPath node-set) It's the 
test to see whether the ancestors need to be crawled for the namespaces. As 
'n' is typically an attribute node, in pyxml DOMs they don't even have a 
namespaceURI attribute, so they are never included.

I noted this bug becaue I use xml.dom.ext.Canonicalize in [1].

[1] http://lists.w3.org/Archives/Public/spec-prod/2003JanMar/0007.html
Python Tool for excerpting schema/examples into XHTML spec