Hi Vishal, My point is that I think that is good to have compatibility with different DOM parsers,but so far I have no found no one that no works with current xml-sec even I have try xerces1 & crimson (at least I remember doing a test, but with JAXP & Xmlbeans I'm sure). If it is not possible to change the behavior of your DOM parser(which one is?) We can think different alternatives. But I think they should wait for future release (I don't want to further delay 1.4) and I think is slow the code about 25-15% in <4k msg (with Juice, with the JCE is very slow to notice anything). But we can discuss this further.
I hope I make myself clear. Regards, On 10/5/06, Vishal Mahajan <[EMAIL PROTECTED]> wrote:
Do others also have views on this discussion? Thanks, Vishal Vishal Mahajan wrote: > Hi Raul, > > The parser that I am working with clearly doesn't intern element > namespace strings which is the reason I ran into this problem. And > actually I am not sure whether it's a good idea for a parser to intern > element namespace strings given that there could be huge number of > elements being parsed and there's a potential risk of running out of > memory. Also you mention that xerces might be interning namespace > stings but looking at their code I was unable to find that. Can you > point me to the relevant piece of code? > > Thanks, > > Vishal > > Raul Benito wrote: >> Vishal the problem is that this codes is called gazillion of times, >> and even it >> seems a small thing, it takes a lot of accumulated time, I even think >> in remove this checking altogether or control it by a property. >> Perhaps there is a feature set in your DOM parser that interns the >> namespaces. I have test with several DOM parsers (xerces, xmlbeans, >> jaxb) and all of them the namespaces strings are interns. >> If you are not able too toggle the behavior, We can begin to think in >> other possibilities (create code on the fly, create an interface with >> one implementation or the other a let the JVM inline it). But I think >> will be the last resort. >> >> Regards, >> Raul >> >> On 10/2/06, Vishal Mahajan <[EMAIL PROTECTED]> wrote: >>> Any signature verification was failing for me, and I have a different >>> DOM implementation in my environment, so probably you are right. It was >>> such a basic error that it had to be something like this. In any >>> case, I >>> think we should keep string comparison safe. >>> >>> Vishal >>> >>> Raul Benito wrote: >>> > Hi Vishal, >>> > >>> > The namespaces strings are intern, at least in xerces. >>> > >>> > Can you post the code that is failing? >>> > >>> > On 10/2/06, Vishal Mahajan <[EMAIL PROTECTED]> wrote: >>> >> This problem was not allowing successful creation of signature space >>> >> elements. Fix attached. >>> >> >>> >> Vishal >>> >> >>> >> >>> >> >>> >> Index: ElementProxy.java >>> >> =================================================================== >>> >> --- ElementProxy.java (revision 451991) >>> >> +++ ElementProxy.java (working copy) >>> >> @@ -281,7 +281,7 @@ >>> >> >>> >> String localnameIS = >>> this._constructionElement.getLocalName(); >>> >> String namespaceIS = >>> this._constructionElement.getNamespaceURI(); >>> >> - if ((namespaceSHOULDBE!=namespaceIS) || >>> >> + if (!namespaceSHOULDBE.equals(namespaceIS) || >>> >> !localnameSHOULDBE.equals(localnameIS) ) { >>> >> Object exArgs[] = { namespaceIS +":"+ localnameIS, >>> >> namespaceSHOULDBE +":"+ localnameSHOULDBE}; >>> >> >>> >> >>> >> >>> > >>> > >>> >>> >>> >> >> > >
-- http://r-bg.com