XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Kim  CassieSubject: java.lang.Math Max() method - returns ClassNotFoundException
Author: Kim Cassie
Date: 07 Apr 2005 12:16 PM
I am trying to invoke a method Max() from java.lang.Math package
from XSLT inside Stylus Studio, but it reports an Exception saying
ClassNotFoundException -- unable to load java.lang.Math

Here is an example of the XSL that uses this method:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="<http://www.w3.org/1999/XSL/Transform>">
<!--<xsl:script implements-prefix="XMLPadding" xmlns:pad="java:localhost.examples.XMLPadding" language="java" src="java:localhost.examples.XMLPadding"/>-->
<xsl:script implements-prefix="Math" xmlns:math="java:java.lang.Math" language="java" src="java:java.lang.Math"/>
<xsl:template match="/">
<impl:getXML>
<intf:data>
<xsl:value-of select="math:max(50,60)" xmlns:math="java:java.lang.Math"/>
</intf:data>
<intf:sourceName>
<xsl:value-of select="trilliumRequest/sourceName"/>
</intf:sourceName>
</impl:getXML>
</xsl:template>
</xsl:stylesheet>

Thank you
- Kim

Posttop
Ivan PedruzziSubject: java.lang.Math Max() method - returns ClassNotFoundException
Author: Ivan Pedruzzi
Date: 07 Apr 2005 01:43 PM
Kim

You need to use the xalanJ processor and the following syntax

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:math="xalan://java.lang.Math">
<xsl:template match="/">
<xsl:value-of select="math:max(50,60)"/>
</xsl:template>
</xsl:stylesheet>

Ivan

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.