Project

Profile

Help

Can't figure out a Saxon command line error

Added by Anonymous over 16 years ago

Legacy ID: #4590314 Legacy Poster: CRA (samurai40k)

Here is the line I have in my batch file (carriage returns are intentional for neatness): java %JVMARGS% -jar C:\Greg\Work\saxonb8-9-0-3j\saxon8.jar net.sf.saxon.Transform -novw -o C:\Greg\Work\ICPlus\fbc01-0003_OUT.xml -s C:\Greg\Work\ICPlus\fbc01-0003.xml style-doc C:\Greg\Work\ICPlus\ImageCrackerPlusTest\ImageCrackerPlus.xsl and I keep getting this error: "Bad param=value pair on command line: -o" Then it goes on to say: "Usage: java net.sf.saxon.Transform [options] style-doc (param=value)..." then it lists the options, which is what I used to build this command line with. I'm using the latest Saxon parser and the latest Java everything. I have no idea what I'm doing wrong (I'm new to the java and Saxon command line stuff). Thanks in advance and I'm sorry if this is a stupid newbie question. I googled for this and couldn't find anything.


Replies (4)

Please register to reply

RE: Can't figure out a Saxon command line err - Added by Anonymous over 16 years ago

Legacy ID: #4590416 Legacy Poster: DD (ddevienne)

With Java, you use either: java -jar app.jar [options] or java app.Main [options] where app.Main is the fully qualified name to the class with a main() entry point (you must set the classpath on the command line or via the CLASSPATH env. var so that the main class can be found). In the first case, the main class is embedded in the jar file's manifest, and all dependent classes must be in the jar, or listed in an in-manifest classpath. You're mixing the two kinds of invocation it looks like. --DD

RE: Can't figure out a Saxon command line err - Added by Anonymous over 16 years ago

Legacy ID: #4590445 Legacy Poster: Michael Kay (mhkay)

Either use java -jar saxon8.jar [options] or java -cp saxon8.jar net.sf.saxon.Transform [options] You have mixed the two. The advantage of the -cp approach is that it allows you to put other things on the classpath as well. Michael Kay http://www.saxonica.com/

RE: Can't figure out a Saxon command line err - Added by Anonymous over 16 years ago

Legacy ID: #4616601 Legacy Poster: Eddie VanArsdall (evanarsdall)

I'm working through the XML Weekend Crash Course, trying to use Saxon to transform XML/XSL to HTML. For the record, I'm not a Java developer, though I use a lot of Java apps and am comfortable with Java installation and configuration. The edition of the book I'm using has XSLT 1.0 files, so I have tried using both Saxon 6.5.5 and Saxon 9 to process the transforms. I initially got past the errors caused by not correctly setting the CLASSPATH variable, but so far I can't seem to do a successful transform. I have tried various command line input, but all I get is Bad param=value pair on command line: <with some variation here>. I tried specifying this in my c:\saxon directory: java -jar saxon9.jar test\standings.xml test\standings_toc.xsl test\toc.htm In this case, Saxon tells me that the bad parameter is toc.htm. I thought I was supposed to indicate an output file, so I don't understand the message. I then tried specifying without the output file, and Saxon tells me that the "Source file standings.xml does not exist." Yet, the file that supposedly doesn't exist is in the same directory with the xsl file. I welcome any help. I did a lot of searching around before posting this question, including the Saxonia help, and I couldn't find anything specific. Eddie

RE: Can't figure out a Saxon command line err - Added by Anonymous over 16 years ago

Legacy ID: #4616811 Legacy Poster: Michael Kay (mhkay)

In Saxon 9 I suggest you use -s:source.xml for the source, -xsl:style.xsl for the stylesheet, and -o:out.html for the output. That way you don't have to worry about the order of the options, and they will never be confused with stylesheet parameters. In fact the output always needs to have a -o, this is the cause of the error message. If it says that a file doesn't exist, that's because it doesn't - or rather, because it's in a different place or is called something different. The most usual cause is getting the current directory wrong.

    (1-4/4)

    Please register to reply