You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Tobias Wahlström <to...@pricerunner.se> on 2000/07/18 15:04:25 UTC

Building XSLT Extentions

Hello!

I want to use Xalan XSLT extentions (in a probably bizarre way). 

As far as I understand the object containing the extentions will be created
by the XSLT processor (or any object that it depends on) at some point
(either when the namespace is initialized or the first time the namespace is
used). 
When using simple extention functions (i.e *not* extention elements) no
reference to the XSLTProcessor is passed, as when an extention element is
used.

The thing is that I want to have such a reference to be able to do my magic
things. 
Is there a way to get this by defining some special constructor or so? 
Is there any better way that I haven't thought of?

I would appritiate some help...

Thanks,
Tobias Wahlström

Re: Building XSLT Extentions

Posted by Gary L Peskin <ga...@firstech.com>.
Tobias --

This is one of a series of changes that I would like to propose and
implement.  For Xalan 1.1, it requires a fairly minor change to
org.apache.xalan.xpath.ExtensionFunctionHandler, at least for extension
functions (as opposed to extension elements).

You would need to check for methods with alternate signatures.  I
haven't done the complete analysis on this as I'm waiting for some
indications of direction from Scott regarding Xalan 2.0 and whether it's
worth it to put these changes into 1.1 or wait for 2.0.

How soon do you need this functionality?

As a workaround, extension elements do receive an XSLProcessorContext. 
You might just implement a java class which supports an element that you
could insert into your stylesheet early on.  Then, you could save the
XSLProcessorContext for later use by your functions.  I haven't looked
into how instances of this class are created and how you could pass that
same instance to your extension function.

Gary

Tobias Wahlström wrote:
> 
> Hello!
> 
> I want to use Xalan XSLT extentions (in a probably bizarre way).
> 
> As far as I understand the object containing the extentions will be created
> by the XSLT processor (or any object that it depends on) at some point
> (either when the namespace is initialized or the first time the namespace is
> used).
> When using simple extention functions (i.e *not* extention elements) no
> reference to the XSLTProcessor is passed, as when an extention element is
> used.
> 
> The thing is that I want to have such a reference to be able to do my magic
> things.
> Is there a way to get this by defining some special constructor or so?
> Is there any better way that I haven't thought of?
> 
> I would appritiate some help...
> 
> Thanks,
> Tobias Wahlström