Page 1 of 1

Oxygen not finding external java functions

Posted: Wed Mar 13, 2019 8:11 pm
by theultimatehack
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??

Re: Oxygen not finding external java functions

Posted: Thu Mar 14, 2019 12:10 pm
by Radu
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

Re: Oxygen not finding external java functions

Posted: Thu Mar 14, 2019 6:27 pm
by theultimatehack
Looks like number 1 was the issues. I repackaged as a .jar and it now works.

Thanks