Registering Custom Extension for Saxon HE
Posted: Fri May 27, 2011 2:43 pm
Hi all. I'm working on a custom extension in order to provide some functions to XSLT by Saxon.
My firs approach was to test Saxon EE provided by Oxigen itself: I created a simple java class, put it in a jar and place this jar in <oxigenx install dir>/lib. Then declaring a namespace such xmlns:see="it.mypackage.MyExtensionClass" it is possible to use the method in a very simple way, calling the method as a normal function:
<xsl:value-of select="see:getString('testo di prova')"/>
By reflection implemented in Saxon EE, it works like a charm, and Oxygen can validate the function and parameters type too
(thanks Saxon, thanks Oxygen).
Second approach was porting such extension on Saxon HE. I created my extension accordingly with info provided on Saxonica and SourceForge web sites. I was able to compile the extension in a jar. Unfortunately indicate the extension in XSLT Scenario is not enough: the transformer is unable to access extension.
What I'm missing? I must create some kind of wrapper or custom XSLT Transformer?
My firs approach was to test Saxon EE provided by Oxigen itself: I created a simple java class, put it in a jar and place this jar in <oxigenx install dir>/lib. Then declaring a namespace such xmlns:see="it.mypackage.MyExtensionClass" it is possible to use the method in a very simple way, calling the method as a normal function:
<xsl:value-of select="see:getString('testo di prova')"/>
By reflection implemented in Saxon EE, it works like a charm, and Oxygen can validate the function and parameters type too

Second approach was porting such extension on Saxon HE. I created my extension accordingly with info provided on Saxonica and SourceForge web sites. I was able to compile the extension in a jar. Unfortunately indicate the extension in XSLT Scenario is not enough: the transformer is unable to access extension.
What I'm missing? I must create some kind of wrapper or custom XSLT Transformer?