XSLT transformation at command line (using Saxon prepackaged with Oxygen)

1.5k Views Asked by At

I am using command line on Mac OS X (10.11.5) to try transformations outside of Oxygen using Saxon (as I get ready to do bulk processing of large sets of XML-TEI files to HTML).

I use the following basic command:

java -cp /Applications/Oxygen XML Editor/lib/saxon9ee.jar net.sf.saxon.Transform  -s:/Users/idjet/Desktop/test/sourcefilename.xml -xsl:/Users/idjet/Desktop/test/transformfilename.xsl -o:/Users/idjet/Desktop/test/testoutput.html

But it produces this error that I can't get to the bottom of:

Exception in thread "main" java.lang.NoClassDefFoundError: XML
Caused by: java.lang.ClassNotFoundException: XML
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

Thanks in advance.

(I admit I'm unfamiliar with Java.)

1

There are 1 best solutions below

2
On

Note that the version of the Saxon JAR file that's distributed with oXygen is not designed to be used outside oXygen. To run Saxon from the command line, first download a free-standing version of Saxon (from SourceForge in the case of Saxon-HE, or from saxonica.com in the case of commercial editions).

In particular, oXygen enables features such as Streaming and Schema-Awareness in Saxon, and to use these features outside the oXygen environment you will need a license key from Saxonica.