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

RE: Extending Java Classes in XSLT2

Subject: RE: Extending Java Classes in XSLT2
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Fri, 11 Oct 2002 10:17:46 +0100
xslt2 java
A tip: using the -t and -T options in Saxon can sometimes give you
better information as to why extension functions are failing to load.

The most likely explanations are: the class is not on the classpath, the
class is not public, the class does not have a public zero-argument
constructor.

Also note, if you invoke Saxon using the "java -jar saxon7.jar" method,
the classpath is effectively empty, so extension functions can only be
loaded using the <saxon:script archive="URL"> technique.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Kurt Cagle
> Sent: 10 October 2002 17:24
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Extending Java Classes in XSLT2
> 
> 
> I have a stupid question to ask, but after spending too many 
> hours last night unsuccessfully trying to do this, I'm 
> getting desperate. I'm using Michael Kay's Saxon 7.2 parser 
> and XSLT 2.0 -- overall, very sweet, by the way -- and I'm 
> trying to get a Java class that I wrote (JPanesque.class) to 
> load through the extension mechanism in XSLT 2. The problem 
> that I'm having is more Java related than XSL -- I know the 
> use of the namespaces designation to load in Java classes, 
> but those relate only to those classes that are specifically 
> in the Java API itself. If the JPanesque.class is in the same 
> directory as the XSLT, how would I get it to load into the
> environment:
> 
> I've tried
> 
> <xsl:stylesheet version="2.0"
>     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
>     xmlns:jp ='java:JPanesque'>
> ....
>     <xsl:variable name="panel" select="jp:new()"/>
> 
> But that generates an error indicating that the new() class 
> is not supported (and thus presumably that the class could 
> not be found).
> 
> -- Kurt Cagle
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.