Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0
This is the forum to discuss the Wrox book XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition by Michael Kay; ISBN: 9780470192740
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old November 24th, 2009, 01:26 PM
Registered User
 
Join Date: Nov 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default calling functions in java.lang.Math

hello everybody,

my question is concerning the sqrtr-example on page 960 of the book.

to invoke the transformation i tried the following variants:

Code:
java -cp saxon9he.jar net.sf.saxon.Transform sqrt.xml  sqrt.xsl
java -cp saxon9he.jar:/Library/Java/Home/lib/ net.sf.saxon.Transform sqrt.xml  sqrt.xsl
java -cp saxon9he.jar:$CLASSPATH net.sf.saxon.Transform sqrt.xml  sqrt.xsl
java -cp saxon9he.jar:$CLASSPATH:. net.sf.saxon.Transform sqrt.xml  sqrt.xsl
java -cp saxon9he.jar:. net.sf.saxon.Transform sqrt.xml  sqrt.xsl
java  net.sf.saxon.Transform sqrt.xml  sqrt.xsl
java  net.sf.saxon.Transform sqrt.xml  sqrt.xsl
java  -cp $CLASSPATH net.sf.saxon.Transform sqrt.xml  sqrt.xsl
but i constantly get errors like
Code:
 Error at xsl:value-of on line 18 column 51 of sqrt.xsl:
  XPST0017: XPath syntax error at char 24 on line 18 in {Math:sqrt(xs:double (.))}:
    Cannot find a matching 1-argument function named {java:java.lang.Math}sqrt()
Failed to compile stylesheet. 1 error detected.
java-version:
Code:
java version "1.5.0_16"
now from my understanding, the java-vm will find the static methods in java.lang.Math without any CLASSPATH-settings. am i right?

how do i have to run the example?

many thanks in advance

michael
  #2 (permalink)  
Old November 24th, 2009, 01:47 PM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

This facility is not available in Saxon Home Edition: you will either need to upgrade to Saxon Professional Edition, or stick with the old Saxon-B release. Sorry about that.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference


Similar Threads
Thread Thread Starter Forum Replies Last Post
java.lang.SecurityException: when calling a jsp mshah101 Apache Tomcat 2 November 9th, 2007 08:28 PM
Graphics Math Functions vb certified Pro VB.NET 2002/2003 2 January 1st, 2006 11:06 AM
Math functions-Please help! jroxit ASP.NET 2.0 Basics 5 December 28th, 2005 12:21 PM
Problem calling static Java functions from XSLT FraserS XSLT 6 October 10th, 2005 07:24 AM
Why are my math functions not being included? jkeen BOOK Beginning Linux Programming, 3rd Edition 4 October 22nd, 2004 05:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.