xsl-list
[Top] [All Lists]

[xsl] calling java methods from a stylesheet

2009-09-21 13:55:52
Hi there,

i have some stylesheets which were written to be processed by the xalan processor. Now I want to switch to saxon. These stylesheets contain java methods that should be executed. Therefore they include the following namespace "xmlns:java="http://xml.apache.org/xslt/java";. The .jar file which holds the java classes is included in the classpath. A method call looks like the following:

<xsl:value-of select="java:de.novum.vger.util.DateUtil.getTodayString()" />

which works fine with xalan.

How can I make these stylesheets work with saxon without changing too much?

I thought it would work like this:

add namespace: xmlns:java="java:de.novum.vger.util.DateUtil"
call method:
<xsl:value-of select="java:getTodayString()" />

but I get the following error:
Error at xsl:value-of on line 40 column 84 of stylesheet_leistungsfall_variabel_dta.xsl XPST0017: XPath syntax error at char 21 on line 40 in {java:getTodayString()}:
   Cannot find a matching 0-argument function named
 {java:de.novum.vger.util.DateUtil}getTodayString()

Why does saxon not find the class, although the jar-file containing it is in the classpath?

regards,
Garvin




--~------------------------------------------------------------------
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>
--~--

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