• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

calling java methods from XSLT  RSS feed

 
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
 
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).]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!