0

Trying to run xalan to do docbook stylesheets, get the following:

(Location of error unknown)XSLT Error (java.lang.NoClassDefFoundError): org/apache/xml/serializer/SerializerTrace

Here is the shell script, Lx.sh

!/bin/sh

export X=/home/leffstudent/docbook-xsl-1.79.1/tools/lib/


export CLASSPATH=$X/xmlresolver.jar:$X/xalan.jar:$X/xercesImpl.jar:$X/xml-apis.jar:/home/leffstudent/docbook-xsl-1.79.1/extensions/xalan27.jar:/home/leffstudent/xsl2/xsl/tools/lib/xalan/serializer.jar
java -Djava.endorsed.dirs=$X org.apache.xalan.xslt.Process -out $1.fo -in $1 -xsl stO.xsl -param use.extensions 1 -param default.table.width auto -param title.margin.left 0pc param insert.xref.page.number yes -param xref.with.number.and.title 0

When I run the script, I get the following error messages

Lx.sh test1.xml

Invalid option: param

Invalid option: insert.xref.page.number

Invalid option: yes



(Location of error unknown)XSLT Error (java.lang.NoClassDefFoundError): org/apache/xml/serializer/SerializerTrace

Exception in thread "main" java.lang.RuntimeException: org/apache/xml/serializer/SerializerTrace

    at org.apache.xalan.xslt.Process.doExit(Process.java:1155)

    at org.apache.xalan.xslt.Process.main(Process.java:1128)

I followed the instructions on page 25 to 26 of the wonderful book: DocBook XSL: The Complete Guide: Second Edition: Sagehill Enterprises

On page 22, that listed three needed jar files: xalan.jar, xml-apis.jar, xercesImpl.jar When that did not work and I got the above error message, I added serializer.jar That did not help.

Note: I originally used saxon to do the conversion of docbook xml to XSL-FO. Someone suggested I try one of the other processors. That is question number 55908387 Thus, I tried Xalan and have the above problem.

Community
  • 1
  • 1
Laurence Leff
  • 76
  • 1
  • 8
  • Because your are at linux box (or Mac) - can you try a xsltproc for these processing??? First step to find out the problem - try to analyze where it is situated. – Eduard Tibet May 03 '19 at 05:52
  • #!/bin/sh xsltproc --output $1.foa --stringparam use.extensions 0 --stringparam table.width auto --stringparam insert.xref.page.number yes --stringparam xref.with.number.and.title 0 stO.xsl $1 ; The above works with no error message. However, still has problem in 55908387. – Laurence Leff May 03 '19 at 23:36
  • In your script you have `param insert.xref.page.number`. A hyphen is missing; it should be `-param insert.xref.page.number`. – mzjn May 04 '19 at 08:25
  • Did you add the missing hyphen? – mzjn May 08 '19 at 18:29
  • I did; no change to this problem. – Laurence Leff May 10 '19 at 19:32

0 Answers0