File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes calling java methods from XSLT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "calling java methods from XSLT" Watch "calling java methods from XSLT" New topic

calling java methods from XSLT

Holger Prause
Ranch Hand

Joined: Oct 09, 2000
Posts: 47
I want to know how to call Java methods from XSLT - I think it has to look like this:
<xsl:stylesheet xmlns:xsl=""

<xsl:value-of select="counter:myMethod('Paramter1',string(Paramter2))"/-->

But i get alway the Exception

Call to extension function failed: de.mycompany.mypackage.myClass
I also set the Classpath.
what do i wrong ?
Thx again,
Ajith Kallambella

Joined: Mar 17, 2000
Posts: 5782
I wish it was that simple, but I learnt it isn't
You will have to make use of XSLT Java extensions. Here is the example from apache website, of XSL that uses XSLT extensions.

Ofcourse, if you find an easier way, please share with us !
Ajith Kallambella M.
Sun Certified Programmer for the Java2 Platform.
[This message has been edited by Ajith Kallambella (edited January 17, 2001).]

Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
I agree. Here's the link:
subject: calling java methods from XSLT
jQuery in Action, 3rd edition