[XML-SIG] Default namespaces, attributes, 4DOM and the W3C recommendation

Alexandre Fayolle Alexandre.Fayolle@logilab.fr
Thu, 27 Sep 2001 17:12:02 +0200 (CEST)


On 26 Sep 2001 paul@boddie.net wrote:

> But, back to vague relevance for this list, does anyone have any hands-on 
> experience with namespace processing along these lines? Might there be any 
> plans in the PyXML world to possibly provide "helper methods" to find the 
> meaning of attributes where such a meaning is inferred from the namespace of 
> the parent element? Finally, is it reasonable to infer "meaning" in such a way? 
> Are there any other likely interpretations for attributes without namespace 
> prefixes?

This will probably not fully answer your question, but what we use in
Narval's development branch to cope with this is code looking like:

attr_ns = attributeNode.namespaceURI or \
          attributeNode.ownerElement.namespaceURI

In other words, we use the element's nsuri if none is given for the
attribute.  The major drawback to this approach is that you need to access
the attribute node itself. 

Alexandre Fayolle
-- 
LOGILAB, Paris (France).
http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org
Narval, the first software agent available as free software (GPL).