Location of extension classes

Here should go questions about transforming XML with XSLT and FOP.
William
Posts: 42
Joined: Sun Jul 15, 2012 12:26 pm
Location: London

Location of extension classes

Post 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
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: Location of extension classes

Post 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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
William
Posts: 42
Joined: Sun Jul 15, 2012 12:26 pm
Location: London

Re: Location of extension classes

Post 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
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: Location of extension classes

Post 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.

Code: Select all

javac -source 1.6 -target 1.6
or if you use an ant script use the javac task like this:

Code: Select all

<javac source="1.6" target="1.6">
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
William
Posts: 42
Joined: Sun Jul 15, 2012 12:26 pm
Location: London

Re: Location of extension classes

Post 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.

Code: Select all

javac -source 1.6 -target 1.6
or if you use an ant script use the javac task like this:

Code: Select all

<javac source="1.6" target="1.6">
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
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: Location of extension classes

Post 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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply