Custom Saxon engine with external libraries

Here should go questions about transforming XML with XSLT and FOP.
Patrik
Posts: 280
Joined: Thu Nov 28, 2013 9:32 am
Location: Hamburg/Germany
Contact:

Custom Saxon engine with external libraries

Post 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
Radu
Posts: 9048
Joined: Fri Jul 09, 2004 5:18 pm

Re: Custom Saxon engine with external libraries

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Patrik
Posts: 280
Joined: Thu Nov 28, 2013 9:32 am
Location: Hamburg/Germany
Contact:

Re: Custom Saxon engine with external libraries

Post by Patrik »

This one works fine. Thanks, Radu! :)

Patrik
Post Reply