xsl-list
[Top] [All Lists]

XSLT/Java question

2003-12-23 09:33:06

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



<Prev in Thread] Current Thread [Next in Thread>