Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calling java methods from XSLT

 
Holger Prause
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic