Page 1 of 1

Custom Saxon engine with external libraries

Posted: Wed Mar 14, 2018 10:49 am
by Patrik
Hi,

I want to use the latest Saxon-HE version (9.8.0.8) with oXygen using my own configuration file that registers extension functions. Thus, I also need to use an additional library that implements these functions.

I already managed to configure SaxonHE-9.8.0.8 as a custom XSLT engine but I can't get it to use my library. Instead, I get this error:
Invalid configuration property extensionFunction. Supplied value 'org.DitaSemia.Diff.GetHashFromStringDef', required value is the name of a class that implements 'net.sf.saxon.lib.ExtensionFunctionDefinition'
My command line looks like this:

Code: Select all

java -cp ${pd}/java/DitaSemiaDiff.jar -jar ${pd}\java\lib\saxonHE-9.8.0.8.jar "-s:${xml}" "-xsl:${xsl}" "-o:${out}" "-config:${pd}/saxon-config.xml
Any idea what I have to do to let saxon find my library DitaSemiaDiff.jar?

Thanks and regards,
Patrik

Re: Custom Saxon engine with external libraries

Posted: Wed Mar 14, 2018 12:44 pm
by Radu
Hi Patrik,

If you remove the -cp ${pd}/java/DitaSemiaDiff.jar part completely, does the reported error message change?
If it changes, then the reason is not that your custom JAR cannot be found but that the "GetHashFromStringDef" does not implement the Saxon "ExtensionFunctionDefinition" abstract class.

If the message does not change, maybe you could try to run Saxon like this:

Code: Select all

java -cp "${pd}/java/DitaSemiaDiff.jar;${pd}\java\lib\saxonHE-9.8.0.8.jar" net.sf.saxon.Transform "-s:${xml}" "-xsl:${xsl}" "-o:${out}" "-config:${pd}/saxon-config.xml
although it should be about the same with what you are doing.

Regards,
Radu

Re: Custom Saxon engine with external libraries

Posted: Wed Mar 14, 2018 1:14 pm
by Patrik
This one works fine. Thanks, Radu! :)

Patrik