Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] Custom function and Saxon

From: "Michael Kay" <mhk@--------->
To:
Date: 5/5/2004 7:47:00 PM
> 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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent