Project

Profile

Help

script/@archive in jar context

Added by Anonymous almost 18 years ago

Legacy ID: #3782884 Legacy Poster: Benoit Maisonny (bnoise)

Hi, I'm running some XSLTs which are stored in a JAR file (AIXM-selector.jar). The main XSLT file imports a second one (coordinates.xslt), which uses a Java extension: <saxon:script language="java" implements-prefix="llc" src="java:Coordinate" archive="Coordinate.jar"/> Coordinate.jar is stored inside AIXM-selector.jar as well, in the same directory. Problem: Saxon doesn't find Coordinate.jar: Error at saxon:script on line 39 of jar:file:/path/to/AIXM-selector.jar!/aixm2eaip/coordinates.xslt: Cannot find class Coordinate in the specified archive All this works fine when run outside AIXM-selector.jar (i.e. not archived). Could this be a limitation of Saxon or perhaps of Java to resolve jar-in-a-jar URLs? Thanks in advance, Benoit


Replies (1)

RE: script/@archive in jar context - Added by Anonymous almost 18 years ago

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

Saxon is simply doing this: javaClass = new URLClassLoader(urls).loadClass(className); where "urls" is an array of the URLs specified in the archive attribute, resolved against the stylesheet base URI, and className is "Coordinate". This is throwing an exception, but unfortunately Saxon doesn't tell you what the exception is (the code is at line 108 in class net.sf.saxon.style.SaxonScript.java if you want to probe it with a debugger). People do report problems with resolution of URIs pointing inside a JAR file from time to time. It's something Saxon leaves entirely to the Java runtime, and it's not an area I understand well. Michael Kay Saxonica

    (1-1/1)

    Please register to reply