aspose file tools*
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
Author

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="http://www.w3.org/1999/XSL/Transform"
xmlns:counter="de.mycompany.mypackage.myClass>

<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,
Holger
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
Holger,
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: http://aspose.com/file-tools
 
subject: calling java methods from XSLT