Project

Profile

Help

How do I tell saxon to use jar file extension

Added by Anonymous about 17 years ago

Legacy ID: #4169889 Legacy Poster: toni (tonicool)

Hi, As one with limited knowledge, I am trying to debug a very large xsl file which normally runs on a UNIX server. On the UNIX server I run saxon in the following manner: java -classpath saxonpath/saxon8.jar:path_to_jar_files_referenced_in_xsl_file/jaxp-1_3/dom.jar:path_to_jar_files_referenced_in_xsl_file/jaxp-api.jar:path_to_jar_files_referenced_in_xsl_file/JCopy.jar net.sf.saxon.Transform -o ./hax2nica.log xmlfile stylesheet The above command works without errors. In xmlspy I use the external command as follows: java -classpath path_to_jar_files_referenced_in_xsl_file/jaxp-1_3/dom.jar;path_to_jar_files_referenced_in_xsl_file/jaxp-api.jar;path_to_jar_files_referenced_in_xsl_file/JCopy.jar c:\saxon8.9\saxon8.jar -o %2 %1 %3 The above command in xmlspy gives a java error indicating that it could not find function named {java:JCopy}copyFile(). In Oxygen I get this to work by adding the jar files as extensions Please could you tell me how I can achive the same thing in xmpspy2006 Thanks Tolu


Replies (7)

Please register to reply

RE: How do I tell saxon to use jar file exten - Added by Anonymous about 17 years ago

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

Sorry, I've no idea. I'd suggest you try running it from the Windows command line. If you can get that to work, then your problem is clearly an XMLSpy problem and you should turn to Altova for help. If you can't get it to work from the command line, then I can help you in the knowledge that there's no third-party software getting in the way. Michael Kay Saxonica Limited

RE: How do I tell saxon to use jar file extension - Added by Anonymous about 17 years ago

Legacy ID: #4172582 Legacy Poster: toni (tonicool)

Hi, Thanks for your reply, I am running the command on the command line and I get back the following error Error at xsl:value-of on line 1349 of file:/C:/testxml/hax2nica.xsl: XPST0003: XPath syntax error at char 45 on line 1349 in {...string($from), xs: string($t...}: Cannot find a matching 2-argument function named {java:JCopy}copyFile() Failed to compile stylesheet. 1 error detected. The JCopy.jar file was included in the class path. However I have not declared a java namespace. I did not have to do this on UNIX. Do you have any ideas as to how I can get it to use my java extension file. Thanks

RE: How do I tell saxon to use jar file exten - Added by Anonymous about 17 years ago

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

Please run with the -TJ option. This will reveal whether it is failing to load the class JCopy or whether it is failing to find the method copyFile() within that class.

RE: How do I tell saxon to use jar file extension - Added by Anonymous about 17 years ago

Legacy ID: #4172772 Legacy Poster: toni (tonicool)

Hi, again thanks for your help. I have run it with -TJ option and it is failing to load the class JCopy. I get back the following message: Loading JCopy No Java class JCopy could be loaded. The JCopy class is not part of a package, but imports java.io.*. Thanks

RE: How do I tell saxon to use jar file exten - Added by Anonymous about 17 years ago

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

That message means either (a) the class isn't on your classpath, or (b) you're using some non-standard ClassLoader. Try using the same classpath setting and doing "javap JCopy" - if javap can load the class but Saxon can't, then we need to look at classLoader issues.

RE: How do I tell saxon to use jar file extension - Added by Anonymous about 17 years ago

Legacy ID: #4172814 Legacy Poster: toni (tonicool)

I am not sure of how the command line should look like. The command I run is as follows: java -classpath C:\saxon8.9\saxon8.jar;C:\saxon8.9\jaxp-1_3\dom.jar;C:\saxon8.9\jaxp-1_3\jaxp-api.jar;C:\saxon8.9\jaxp-1_3\JCopy.jar net.sf.saxon.Transform -o outputfile xmlfile xslfile or should I be using "javap JCopy" in the xsl file. Thank you

RE: How do I tell saxon to use jar file exten - Added by Anonymous about 17 years ago

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

No, "javap JCopy" is another separate command to get diagnostics. Please run the following from the command line (all on one line): javap -classpath C:\saxon8.9\saxon8.jar;C:\saxon8.9\jaxp-1_3\dom.jar;C:\saxon8.9\jaxp-1_3\jaxp-api.jar;C:\saxon8.9\jaxp-1_3\JCopy.jar JCopy If JCopy can be loaded, this will give you a list of the public methods found. If JCopy can't be loaded, then it means that JCopy isn't on this classpath, and Saxon won't be able to load it either.

    (1-7/7)

    Please register to reply