Location of extension classes

Here should go questions about transforming XML with XSLT and FOP.

Location of extension classes

Postby William » Tue Jul 17, 2012 10:43 am

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
William
 
Posts: 42
Joined: Sun Jul 15, 2012 12:26 pm
Location: London

Re: Location of extension classes

Postby adrian » Tue Jul 17, 2012 11:01 am

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

Re: Location of extension classes

Postby William » Tue Jul 17, 2012 11:31 am

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
William
 
Posts: 42
Joined: Sun Jul 15, 2012 12:26 pm
Location: London

Re: Location of extension classes

Postby adrian » Tue Jul 17, 2012 11:44 am

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

Re: Location of extension classes

Postby William » Tue Jul 17, 2012 12:08 pm

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
William
 
Posts: 42
Joined: Sun Jul 15, 2012 12:26 pm
Location: London

Re: Location of extension classes

Postby adrian » Tue Jul 17, 2012 1:15 pm

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


Return to XSLT and FOP

Who is online

Users browsing this forum: No registered users and 0 guests