Page 1 of 1
Location of extension classes
Posted: Tue Jul 17, 2012 10:43 am
by William
Hello,
Can you tell me where I put a .jar file containing a class I want to use within an XSLT transformation? I simply can't get this to work I have tried every conceivable logical location. I'm using XML Developer v14 Ent Ed on Debian (x64).
Within my stylesheet declaration I'm using :
Code: Select all
xmlns:xalan="http://xml.apache.org/xslt"
xmlns:src="xalan://src.functions.BlockCalculator"
But when I try to run the transformation I'm told that a matching methods cannot be found.
--
William
Re: Location of extension classes
Posted: Tue Jul 17, 2012 11:01 am
by adrian
Hello,
It doesn't matter where the .jar library is located, what's important is to configure the transformation scenario and add it there as an extension.
Edit the scenario: Document > Transformation > Configure Transformation Scenario (there's a corresponding action in the toolbar), Edit. In the XSLT section press the Extensions button and add the .jar library there.
Regards,
Adrian
Re: Location of extension classes
Posted: Tue Jul 17, 2012 11:31 am
by William
adrian wrote:Hello,
It doesn't matter where the .jar library is located, what's important is to configure the transformation scenario and add it there as an extension.
Edit the scenario: Document > Transformation > Configure Transformation Scenario (there's a corresponding action in the toolbar), Edit. In the XSLT section press the Extensions button and add the .jar library there.
Regards,
Adrian
Thanks for that Adrian, I've made some progress however, when I apply this transformation I now get :
Description: src/functions/BlockCalculator : Unsupported major.minor version 51.0
The jar file in question was built using JDK1.7.0_03 on the same machine as I'm running this.
Any thoughts on this?
--
William
Re: Location of extension classes
Posted: Tue Jul 17, 2012 11:44 am
by adrian
Hi,
By default Oxygen uses Java SE 6 (1.6). If you compile the Java classes with JDK 1.7, you will have to compile them with 1.6 compatibility.
e.g.
or if you use an ant script use the javac task like this:
Regards,
Adrian
Re: Location of extension classes
Posted: Tue Jul 17, 2012 12:08 pm
by William
adrian wrote:Hi,
By default Oxygen uses Java SE 6 (1.6). If you compile the Java classes with JDK 1.7, you will have to compile them with 1.6 compatibility.
e.g.
or if you use an ant script use the javac task like this:
Regards,
Adrian
Hello again Adrian, I can't do this as we use 1.7 specific code is there a way I can change the JRE used by oXygen?
--
William
Re: Location of extension classes
Posted: Tue Jul 17, 2012 1:15 pm
by adrian
Hello,
You could bypass the Java VM bundled with Oxygen and use the one installed on your system or simply replace it. The bundled Java VM is located in the 'jre' folder from the Oxygen installation folder. Either rename that and Oxygen will try to pick Java from the JAVA_HOME or PATH environment variables, or replace it with your own.
You can check the Java VM version in Oxygen in: Help > About, System properties, "java.runtime.version"
Regards,
Adrian