You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@santuario.apache.org by "Pantvaidya, Vishwajit" <vp...@selectica.com> on 2006/05/12 01:16:20 UTC

RE: "Unknown canonicalizer. No handler installed for URI" with di ffer ent xml beans version

> -----Original Message-----
> From: Pantvaidya, Vishwajit
> Sent: Thursday, May 11, 2006 12:25 PM
> To: security-dev@xml.apache.org
> Subject: RE: "Unknown canonicalizer. No handler installed for URI" with di
> ffer ent xml beans version
> 
> > > I have debugged the code upto the point of the exception and I see
> that
> > > with both xml beans versions, the xml itself does have the
> canonicalizer
> > > uri - but the Element. getAttributeNS call returns null when our xml
> > > beans is used and then we get the exception.
> > >
> > > Any idea why/when would this happen?
> >
> > It sounds as if the DOM tree is not namespace aware in the xml beans
> > case. It must be namespace aware, for example you should invoke
> > DocumentBuilderFactory.setNamespaceAware(true) before parsing the
> > document.
> >
> > --Sean
> 
> 
> Any idea why one of the xmlbeans versions is working - the xmlbeans jar
> contents for it do not seem to contain anything that should impact this.
> 
> 
> - Vish.

Debugged this further - saw that following difference that seems to be
responsible for this issue:
- With my xml beans - the xmlbeans to dom conversion using
xmlobject.newDomNode() results in the node having namespaceuri=""
- With the other xml beans - the conversion results in the node having
namespaceuri=null
So in SignedInfo.getCanonicalizationMethodURI,
Element.getAttributeNS(null,"Algorithm") matches the null uri in the latter
case and so it works.
I am thinking of changing the line in SignedInfo to
Element.getAttributeNS("Algorithm") i.e. eliminate the null namespaceuri
parameter - that works.

Any suggestions?

Thanks for all the help,

Vish.