You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Vadim Gritsenko <va...@verizon.net> on 2003/05/23 02:31:51 UTC
[PATCH] Re: Problems with org.apache.excalibur.xml.xslt.XSLTProcessorImpl
Dear Avaloners:
Please take a second to look at/apply the supplied patch. It's short and
pretty straightforward.
Volker:
volker.schmitt@basf-it-services.com wrote:
>Hi,
>
>I found out a problem using
>"org.apache.excalibur.xml.xslt.XSLTProcessorImpl".
>
>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 ?
>
>
Vadim
[1]
http://cvs.apache.org/viewcvs.cgi/avalon-excalibur/xmlutil/src/java/org/apache/excalibur/xml/xslt/XSLTProcessorImpl.java?annotate=1.31
[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.
>
>Volker
>
RE: [PATCH] Re: Problems with org.apache.excalibur.xml.xslt.XSLTProcessorImpl
Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Patch applied.
Thanks!
Carsten
> -----Original Message-----
> From: Vadim Gritsenko [mailto:vadim.gritsenko@verizon.net]
> Sent: Friday, May 23, 2003 2:32 AM
> To: dev@avalon.apache.org
> Cc: cocoon-dev@xml.apache.org
> Subject: [PATCH] Re: Problems with
> org.apache.excalibur.xml.xslt.XSLTProcessorImpl
>
>
> Dear Avaloners:
> Please take a second to look at/apply the supplied patch. It's short and
> pretty straightforward.
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org