Perhaps you invoked the processor using the -jar option? In this case,
Java ignores the classpath setting. Use the "java
com.icl.saxon.Stylesheet" option instead.
This is just one possibility. It's difficult to solve problems like this
remotely. It definitely means that Saxon has asked Java to load the
class and Java is saying it can't; but there could be any number of
reasons for that, from the information given.
Michael Kay
-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of
pcarey(_at_)lexmark(_dot_)com
Sent: 23 December 2003 16:33
To: XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] XSLT/Java question
Hello XSLT gurus.
I am using Saxon 6.5.3 and I would like to have access to
some java methods I've defined. I looked through the
archives, and I think I found the answer
here: http://www.dpawson.co.uk/xsl/sect4/N9723.html.
For some reason, though, I cannot seem to get this to work. I
have been successful in using the built-in java classes (such
as java.lang.Math), but I'm stuck when trying to use my own
classes. Below are the relevant portions of XSLT and java. If
anyone has any ideas why this fails, I would be extremely grateful.
Thanks, Pete
Here is the error:
============================================================
The URI java:TestClass does not identify an external Java class
Here is my CLASSPATH:
============================================================
.;..;E:\XSLT_CLASSES;E:\saxon\saxon.jar
Here is the java class, compiled in E:\XSLT_CLASSES:
============================================================
public class TestClass
{
public static String returnMyName(){ }
}
Here is the xsl:stylesheet element and its attributes:
============================================================
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:saxon="http://icl.com/saxon"
xmlns:java="java:TestClass"
extension-element-prefixes="saxon">
Here is where I attempted to call the returnMyName() method"
============================================================
<xsl:variable name="test-variable">
<xsl:value-of select="java:returnMyName()"/> </xsl:variable>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list