Oxygen not finding external java functions

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
theultimatehack
Posts: 2
Joined: Thu Sep 27, 2018 7:06 pm

Oxygen not finding external java functions

Post by theultimatehack » Wed Mar 13, 2019 8:11 pm

In my XSLT I have the following declaration
xmlns:MyFunction="java:com.somepath.MyFunctions"

In both my Validation Scenario Settings as well as my Debug Scenario Settings, I am using the extensions button(s) to add a library that points to the MyFuncations.class file

This does not seem to work in either the editor validation nor during a debug scenario Saxon-PE 9.6.0.7 engine.

For all method calls Im getting "Cannot find a matching 'x'-argument function named........ where is is the number of parms for the method call.

Any suggestions??

Radu
Posts: 6335
Joined: Fri Jul 09, 2004 5:18 pm

Re: Oxygen not finding external java functions

Post by Radu » Thu Mar 14, 2019 12:10 pm

Hi,

There can be various potential problems:

1) The class is not properly packed in the JAR library, for example you may not have included the "com/somepath" folder structure inside which the class resides.
2) The method that you want to call is not defined as static.
3) Somehow the XSLT processor considers that it cannot cast the XSLT parameters to the Java object types specified in your method.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

theultimatehack
Posts: 2
Joined: Thu Sep 27, 2018 7:06 pm

Re: Oxygen not finding external java functions

Post by theultimatehack » Thu Mar 14, 2019 6:27 pm

Looks like number 1 was the issues. I repackaged as a .jar and it now works.

Thanks

Post Reply