Well - at least I'm not the only one with this problem. Are there any Xalan developers on this list who can answer this question? I did find the following on the Xalan-J website, although I still can't get it to make the call. If this isn't supported, does anyone know any other way to make java calls in a stylesheet using a translet/xsltc with xalan or any other xsl transform package?
http://xml.apache.org/xalan-j/xsltc_constraints.html ----- At the time of writing, only static methods are supported. A call to a function whose namespace is either <http://xml.apache.org/xslt/Java or <http://xml.apache.org/xalan/xsltc/Java is resolved by loading the appropriate class and calling a static method that matches the signature of the function. The class can be specified as part of the namespace URI or as part of the function call as shown in the following example: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:Java="http://xml.apache.org/xslt/Java" xmlns:Java-system="http://xml.apache.org/xslt/Java/java.lang.System"> <xsl:template match="/"> <xsl:value-of select="Java:java.lang.System.currentTimeMillis()"/> <xsl:value-of select="Java-system:currentTimeMillis()"/> </xsl:template> </xsl:stylesheet> ----- Thanks, - Brent |---------+----------------------------> | | Mario Felarca | | | <[EMAIL PROTECTED]| | | com> | | | | | | 07/24/2002 05:12 | | | PM | | | | |---------+----------------------------> >------------------------------------------------------------------------------------------------------------------------------| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: Revisited - Translets with Extensions not supported? | >------------------------------------------------------------------------------------------------------------------------------| At 05:01 PM 7/24/2002 -0400, [EMAIL PROTECTED] wrote: Just to add my $0.02, but I am getting the exact same thing with the exact same scenario. I am using Xalan 2.4D1. Also, upon startup, I get these types of warnings as I am generating Templates objects using the xsltc TransformerFactoryImpl. WARNING: file:///<xsl-stylesheet>.xsl: Unable to resolve call to function '<fully.qualified.classname:static-method-name' Any ideas? Thanks in advance, Mario- >OK - well I finally got the package name set, the correct classname and >everything. Now when I attempt to compile this it gets to my exension >method call and I get this RuntimeException: > >java.lang.RuntimeException: External function >'xalan://com.company.util.ExtUtils:getAuthIDRequest' not supported by >XSLTC. > >Are external functions supported at all? Maybe only certain ones? Here is >an example of the call from the XSL stylesheet... > >...snip... ><xsl:stylesheet > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > version="1.0" > xmlns:util="xalan://com.company.util.ExtUtils" > xmlns:xalan="http://xml.apache.org/xslt" > exclude-result-prefixes="util" > > >...snip... ><AUTHID><xsl:value-of select="util:getAuthIDRequest()"/></AUTHID> >...snip... > >Then I've got a method in the ExtUtils class similar to this ... > >...snip... >public static String getAuthIDRequest() { > return("Something"); >} >...snip... > >I'm SO close - if I can just get this to work! > >Thanks, > >- Brent
