[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Custom function and Saxon

Subject: RE: Custom function and Saxon
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Wed, 5 May 2004 18:47:11 +0100
xalan custom function
> I'm trying to use several java custom functions i wrote.
> First, I've put the java class in a jar file (function.jar) 
> and include the
> following code in my xsl file :
> 
> <xsl:stylesheet 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="
> 1.0"
>   xmlns:java="http://xml.apache.org/xslt/java"
>   xmlns:pfx="java:Custom">
> 
> Here is the code i use in order to print a trimmed data :
> 
>       <IdFamily><xsl:value-of select="pfx:trim('    Test     ')"/></
> IdFamily>
> 
>  When i execute the Saxon processor,  it works well !

I don't think this will work in Saxon. You are using the Xalan way of
calling Java extension functions, and this will only work in Xalan. I
suspect you are using Xalan and not Saxon. Check the value of
system-property('xsl:vendor').
> 
> Now, i want to include all the classes contained in the same jar file.
> Let's say i have twos classes names example1.class and 
> example2.class in my
> jar file. How can i use all the functions specified in the 
> two class files
> without naming all this classes ?

Saxon's binding of Java extension functions does not allow you to call a
Java method without explicitly naming the class that it belongs to as part
of the URI used in the function name.

Michael Kay

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.