The message means that it's looking for a class called MyClass and can't
load one. If the class really is called MyClass, then changing the URI isn't
going to help.
With exactly the same classpath, try
javap MyClass
from the command line.
Some reasons that such problems occur:
- the class is in a package
- the class isn't on the classpath
- the class isn't public
Try also giving the class a public default constructor. I don't think that
should make any difference, but it could.
Michael Kay
http://www.saxonica.com/
-----Original Message-----
From: Richard Lewis [mailto:richardlewis(_at_)fastmail(_dot_)co(_dot_)uk]
Sent: 15 February 2005 16:21
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Saxon: java extension functions
Hello List,
This is a Saxon question:
I'm using Saxon 8.2B and I'm trying to add an extension
class, MyClass.
<xsl:stylesheet version="2.0" ...
xmlns:my="java:MyClass">
and create an instance of it:
<xsl:variable name="myClass" select="my:new($parameter)" />
and then call an instance function:
<xsl:variable name="x" select="my:getX($myClass, $parameter)" />
But, running Saxon with the -TJ options, I get "No Java class MyClass
could be loaded". I've tried every namespace I could think of
("java://MyClass", "MyClass", "java:/usr/share/java/MyClass",
"MyClass.class", etc.) but none of them work. The class is in the
classpath (I even tried compiling and running a little Java program
using it and that worked).
Any ideas what I've done wrong?
Cheers,
Richard
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--