Search code examples
xmlxsltcommand-linesaxonoxygenxml

How to add manifest for command line Saxon XSLT transformation


I want to run an XSLT transformation from the command line, using the Saxon processor that comes bundled with the Oxygen XML editor. I tried the following, but got the error message "Failed to load Main-Class manifest attribute". I realize that I need to create and then invoke a manifest file, but I'm not sure how to do this.

C:\>java -jar "C:\Program Files\Oxygen XML 
Editor 18\frameworks\docbook\xsl\extensions\saxon65.jar" -s:"C:\test.xml" 
-o:"C:\output.xhtml" -xsl:"C:\test.xslt"

Failed to load Main-Class manifest attribute from
C:\Program Files\Oxygen XML Editor
18\frameworks\docbook\xsl\extensions\saxon65.jar

Solution

  • ! I doubt you need a manifest if you take the correct jar.

    Take the JARs from S:\Program Files\Oxygen XML Developer 17\lib (similiar path at your system).

    Documentation for Saxon 6.5.5 command line:

    http://saxon.sourceforge.net/saxon6.5.5/using-xsl.html

    java  -jar dir/saxon.jar   [options]   source-document   stylesheet   [ params…]
    

    While in Folder lib of Oxygen via command line:

    java -jar saxon.jar -o C:\output.xml C:\input.xml C:\stylesheet.xsl
    

    Documentation for Saxon 9.6 command line:

    http://www.saxonica.com/html/documentation9.6/using-xsl/commandline.html