You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Chris Gow <cg...@digitalfairway.net> on 2000/10/02 18:35:06 UTC

Calling Java methods in XSL

Hi:

How do I call a Java method inside an XSL file?  I tried following the
examples in the 'XSLT Programmer's Reference' by Wrox press, but they
keep giving me Class Not Found errors.

Here's a partial stack trace

java.lang.NoClassDefFoundError: com/ibm/bsf/BSFException
                              at
org.apache.xalan.xpath.xml.XMLParserLiaisonDefault.extFunction(XMLParserLiaisonDefault.java:1828)

                              at
org.apache.xalan.xpath.XPath.extfunction(XPath.java:1015)

This is the XSL stylesheet I am using:

<xsl:stylesheet
        version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:date="http://xsl.lotus.com/java">

<xsl:template match="/">
   <html xsl:exclude-result-prefixes="date">
   <body>
      <p><xsl:value-of
select="date:to-string(date:java.util.Date.new())"/></p>
   </body>
   </html>
</xsl:template>

</xsl:stylesheet>


I am assuming that the namespace has changed since the book has been
released, if so, what is the correct way to call a Java method inside
XSL.

Thanks

Chris Gow