avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <vadim.gritse...@verizon.net>
Subject [PATCH] Re: Problems with org.apache.excalibur.xml.xslt.XSLTProcessorImpl
Date Fri, 23 May 2003 00:31:51 GMT
Dear Avaloners:
Please take a second to look at/apply the supplied patch. It's short and 
pretty straightforward.


volker.schmitt@basf-it-services.com wrote:

>I found out a problem using
>If use-store is true the stylesheet template is cached inside the store and
>reused for the next transformation. The problem is, that the template and
>the factory hold a reference to the URIResolver which is the
>XSLTProcessorImpl itself.
>Is the URIResolver only used while creating the template?

No, it's used to resolve xsl:import and document() too.

>If yes the
>current implementation works but we should set the URIResolver to null
>after the template is created.

URIResolver is set to Transformer created on base of Templates, and not 
to Templates, see line 330 [1]

>If no, we may be use an URIResolver
>(XSLTProcessorImpl) which is already recycled and an other problem is that
>the resolve method isn't  ThreadSafe.

This can be fixed by adding setURIResolver() (as it is done in line 330) 
between lines 614-615 (patch attached)

>This is an problem because the same
>template is used from multible threads.

No, it's not. Templates is thread-safe object:

"Templates must be threadsafe for a given instance over multiple threads 
running concurrently, and may be used multiple times in a given 
session." [2]

>In Cocoon the template is automatic put into an persistent store if the
>memory store is full. The XSLTProcessorImpl is not serializable which ends
>in an java.io.NotSerializableException. I think it doesn't make sense to
>store an XSLT-Template into an persistent store ?


[2] http://xml.apache.org/xalan-j/apidocs/javax/xml/transform/Templates.html

>I also propose to make the Validity check configurable, this will improve
>performance in productiv environments.

View raw message