I can't add a JAR from a plugin to the DITA OT 3.3.1 classpath

54 views
Skip to first unread message

Damien Bories

unread,
Nov 14, 2019, 10:36:08 AM11/14/19
to DITA-OT Users
Hi everyone,

I am writing a plugin for DITA OT PDF2. This plugin needs extension functions, so I followed the tutorials from the DITA OT website:
and

The jar is next to the plugin.xml file and I have this feature:

<feature extension="dita.conductor.lib.import" file="./xslt-extension.jar"/>

Sadly, I get an XSLT compilation error:

transform.topic2fo.main:
 
[pipeline] Static error in {ftd:lastApplicability()} in expression in xsl:variable/@select on line 30 column 79 of applicability.xsl:
 
[pipeline]   XPST0017: Cannot find a 0-argument function named {https://orlandotechpubs.com/}lastApplicability()
 
[pipeline] Static error near {...eApplicability($applicabili...} in expression in xsl:value-of/@select on line 99 column 69 of applicability.xsl:
 
[pipeline]   XPST0017: Cannot find a 1-argument function named {https://orlandotechpubs.com/}writeApplicability()

I double checked everything and my extension functions are defined correctly. So I tried to debug by creating a simple java "main" that I call from a target:

    <target name="testJava">
     
<java classname="com.infotel.ftd.MyTest">
     
</java>
   
</target>

The target is called before "clean-temp" in the pipeline:

 <feature extension="depend.preprocess.clean-temp.pre" value="testJava"/>

And now I get the following error:

 [java] Could not find com.infotel.ftd.MyTest. Make sure you have it in your classpath

So I understand that my JAR file is not added to the classpath, but why? I even looked in env.bat and the jar is listed there:

set "CLASSPATH=%CLASSPATH%;%DITA_HOME%\plugins\org.dita.pdf2\lib\fo.jar"
set "CLASSPATH=%CLASSPATH%;%DITA_HOME%\plugins\com.infotel.orlando.pdf\xslt-extension.jar"
set "CLASSPATH=%CLASSPATH%;%DITA_HOME%\plugins\org.dita.eclipsehelp\lib\eclipsehelp.jar"
set "CLASSPATH=%CLASSPATH%;%DITA_HOME%\plugins\org.dita.htmlhelp\lib\htmlhelp.jar"
set "CLASSPATH=%CLASSPATH%;%DITA_HOME%\plugins\org.dita.pdf2.axf\lib\axf.jar"
...



Radu Coravu

unread,
Nov 15, 2019, 1:25:40 AM11/15/19
to Damien Bories, DITA-OT Users
Hi Damien,

I commented on your stack overflow post:

In addition, how are you running the DITA OT? You should try to run it using the "dita" command which properly loads all JAR libraries: https://www.dita-ot.org/dev/topics/build-using-dita-command.html

Regards,
Radu

--
You received this message because you are subscribed to the Google Groups "DITA-OT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/dita-ot-users/98f5ccd4-ff81-44ca-b47a-448a4197c5f4%40googlegroups.com.

Damien Bories

unread,
Nov 15, 2019, 5:16:38 AM11/15/19
to DITA-OT Users
Hi Radu,

This was my problem indeed. I realised that yesterday night. I was using an ant build to launch DITA OT and apparently the JAR libraries are not loaded automatically.

I switched to the "dita.bat" command line and now my extension functions are seen by the XSLT.

Best regards.
To unsubscribe from this group and stop receiving emails from it, send an email to dita-o...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages