xmlxsltsaxon

Error: Could not find or load main class net.sf.saxon.Transform


Edit

I am having an XSLT to convert my xml into html format(I dont know anything about XSLT, i am having which already written by someone).

This is what i am doing in command line

java -Xss2m -Xmx512m -cp <jarfile>.jar net.sf.saxon.Transform <xsltname> <inputfilename> <outputfilename>

While converting my xml file with my XSLT i am getting an following error

Error: Could not find or load main class net.sf.saxon.Transform

I dont know why can any one help me..


Solution

  • Initial response:

    [You need to tell us exactly what you were doing, then we have some chance of telling you what you were doing wrong.

    This isn't the normal error you get when you invoke Saxon from the command line, so I suspect you were invoking it from some other application. The cause is almost certainly that the Saxon JAR file is not on the classpath (though it could be some other similar problem, such as not having permissions to load the JAR file). The way you set up the classpath may depend on the application you are using, for example it's not the same if you are running Tomcat versus running directly form the command line.]

    Amended after more information supplied:

    The error almost certainly means that you got the path <jarfile>.jar wrong. Try navigating to it and copying the path, or using shell auto-completion.