I can't see what's going wrong here, but it's almost certainly a load failure of some kind. Unfortunately the actual loader error message is masked.
 
You might try doing
 
<xsl:variable name="debug"
 select="loader:getClass('com.cerillion.tools.util.MyTest')"
 xmlns:loader="java:com.icl.saxon.Loader"/>
 
This reproduces the call Saxon is making to load your class. If it fails, you should get the text of the loading exception.
 
Mike Kay
 
 -----Original Message-----
From: saxon-help-admin@lists.sourceforge.net [mailto:saxon-help-admin@lists.sourceforge.net]On Behalf Of Luke Studley
Sent: 16 November 2001 12:11
To: 'saxon-help@lists.sourceforge.net'
Subject: [saxon] Loading a Java class Errors

Help!!

 

Trying to call a java class method from XSL. Have done this loads of times in the past, but some of our old stylesheets have stopped working since saxon 622. Have created a simple test case. Feel like I'm going mad - this is really basic!! Have checked and triple checked the classpath settings - and am convinced the class is in the class path - in the trace saxon says that it is loading the class but says: (Have also tried this with 622,63,643 and 65)

 

SAXON 6.5 from Michael Kay

Java version 1.3.1

Loading java.util.Date

Loading java.util.Date

Loading com.cerillion.tools.util.MyTest

Preparation time: 390 milliseconds

Processing file:/C:/Development/Perforce/frost/oracle/src/middleware/java/com/ce

rillion/tools/entity_generator/xsl/WebCareConfig.xml

Building tree for file:/C:/Development/Perforce/frost/oracle/src/middleware/java

/com/cerillion/tools/entity_generator/xsl/WebCareConfig.xml using class com.icl.

saxon.tinytree.TinyBuilder

Tree built in 150 milliseconds

Error at xsl:value-of on line 8 of file:/C:/Development/Perforce/frost/oracle/sr

c/middleware/java/com/cerillion/tools/entity_generator/xsl/GeneralUtilsTest.xsl:

 

  The URI /com.cerillion.tools.util.MyTest does not identify an external Java cl

ass

Transformation failed: Run-time errors were reported

 

Here is the stylesheet:

 

<?xml version="1.0"?>

<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

            xmlns:mytest="/com.cerillion.tools.util.MyTest"

        xmlns:date="/java.util.Date">

 

<xsl:template match="/">

    <xsl:value-of select="date:to-string(date:new())"/>

    <xsl:value-of select="mytest:getMessage()"/>

</xsl:template>

 

</xsl:stylesheet>

 

And here is the java class

 

public class MyTest {

 

    public static String getMessage() {

        return "Hello World";

    }

   

}

 

Can anyone point out my - probably elementary - mistake?

 

Cheers

 

Luke