You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@santuario.apache.org by Marius Constantin <mc...@digev.com> on 2003/12/10 20:43:10 UTC

canonicalization fails

Hi all,

Here is the scenario:
 - I parse an XML from an stream.
 - I use the Document instance to create a new Element node (elNode). I add two attributes to it. One of these attributes is a namespace definition. I add it using elNode.setAttribute( "xmlns:ns1", "http://localhost/temp" )
 - After this I sign the message. It fails in the Canonicalizer, when it tries to sort the attributes (NonNSAttrCompare.compare; the call to the attr.getLocalName returns null for both attributes.) What I observed is that all the other attributes (of the nodes parsed from the stream,) are sorted using the NSAttrCompare class. Going further, I have observed that the Element I create is an instance of ElementNSImpl and its attributes are AttrImpl whereas all the other Element nodes are DeferredElementNSImpl and their attributes are DeferredAttrNSImpl... I think the problem lies somewhere in this area but I couldn't find a way to create the "Deferred" types...
Am I on the right path? Any ideas, suggestions on how to go ahead with this?

Thanks,
 Marius