You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Roytman, Alex" <ro...@peacetech.com> on 2001/03/09 02:05:55 UTC

Extension Functions & Transformation Thread in J2EE. Passing Cont ext to Extenuation Functions explicitly via Transformer

Hello,

Transformation thread created by Xalan does not inherit any properties of
the thread where transformer was created. This prevents Xalan extensions
from getting proper context provided by J2EE containers (i.e. InitialContext
etc.) which is associated with invoking thread. 

Scott mentioned earlier that they will probably provide an option to tell
transformer to do transformation on invoking thread. Is it still the plan?

Do you think it might be a good idea to allow to set attributes for
transformer

myTransformer.setAttribute(String name, Object value);

so they can be accessed in an extension function/element

I believe it will be very useful apart from second thread related issues.
I noticed that if we do myTransformer.setParameter(name, value)
this parameter is accessible by both <xsl:value-of> and
XPathContext.getVariable()
even though it was not declared in the stylesheet - no errors/warnings
raised
Is it intended behavior or just a bug? If it is a bug would you fix it for
both
<xsl:value-of>  and XPathContext.getVariable()? may be you can let 
XPathContext.getVariable() to access it?


PS
Are you using one threads in Xalan1?  
All my extensions which rely on new InitialContext() being thread specific 
work just fine under Xalan1. Of course they break with Xalan2


Thank you 

Alex

Re: Extension Functions & Transformation Thread in J2EE. Passing Context to Extenuation Functions explicitly via Transformer

Posted by Gary L Peskin <ga...@firstech.com>.
> "Roytman, Alex" wrote:
> Transformation thread created by Xalan does not inherit any properties
> of the thread where transformer was created. This prevents Xalan
> extensions from getting proper context provided by J2EE containers
> (i.e. InitialContext etc.) which is associated with invoking thread.
> PS
> Are you using one threads in Xalan1?
> All my extensions which rely on new InitialContext() being thread
> specific
> work just fine under Xalan1. Of course they break with Xalan2

Hi, Alex --

I'm not sure what you mean here.  If you mean that your extensions rely
on being able to tie a specific InitialContext to a particular
transformer, can't you just pass in your transformer (ie thread)
-specific information with a parameter in setParameter.

> Do you think it might be a good idea to allow to set attributes for
> transformer
> 
> myTransformer.setAttribute(String name, Object value);
> 
> so they can be accessed in an extension function/element
>
> I believe it will be very useful apart from second thread related
> issues.

Can't you do this with setParameter?

> I noticed that if we do myTransformer.setParameter(name, value)
> this parameter is accessible by both <xsl:value-of> and
> XPathContext.getVariable()
> even though it was not declared in the stylesheet - no errors/warnings
> raised
> Is it intended behavior or just a bug? If it is a bug would you fix it
> for both
> <xsl:value-of>  and XPathContext.getVariable()? may be you can let
> XPathContext.getVariable() to access it?

This is a bug.  I have entered into bugzilla as bug 914.  I'm working on
a fix which should be uploaded shortly (I hope!).  Look for the bugzilla
postings to the list for bug 914.

Gary