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

RE: Saxon: java extension functions

Subject: RE: Saxon: java extension functions
From: "Richard Lewis" <richardlewis@xxxxxxxxxxxxxx>
Date: Tue, 15 Feb 2005 17:06:58 +0000
saxon java namespace
On Tue, 15 Feb 2005 16:48:33 -0000, "Michael Kay" <mike@xxxxxxxxxxxx>
said:
> The message means that it's looking for a class called MyClass and can't
> load one. If the class really is called MyClass, then changing the URI
> isn't
> going to help.
> 
Fair enough.
> 
> With exactly the same classpath, try
> 
> javap MyClass
> 
> from the command line.
> 
Yep, it works.

> Some reasons that such problems occur:
> 
> - the class is in a package
It's not (in fact, I tried putting it in one and altering the namespace
accordingly, but it didn't help)

> - the class isn't on the classpath
which it is.

> - the class isn't public
I'm afraid it is.

> 
> Try also giving the class a public default constructor. I don't think
> that
> should make any difference, but it could.
Tried that and no, it didn't.

Do you want me to post the code?

> 
> Michael Kay
> http://www.saxonica.com/
>  
> 
> > -----Original Message-----
> > From: Richard Lewis [mailto:richardlewis@xxxxxxxxxxxxxx] 
> > Sent: 15 February 2005 16:21
> > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > Subject:  Saxon: java extension functions
> > 
> > Hello List,
> > 
> > This is a Saxon question:
> > 
> > I'm using Saxon 8.2B and I'm trying to add an extension 
> > class, MyClass.
> > 
> > <xsl:stylesheet version="2.0" ...
> >     xmlns:my="java:MyClass">
> > 
> > and create an instance of it:
> > 
> > <xsl:variable name="myClass" select="my:new($parameter)" />
> > 
> > and then call an instance function:
> > 
> > <xsl:variable name="x" select="my:getX($myClass, $parameter)" />
> > 
> > But, running Saxon with the -TJ options, I get "No Java class MyClass
> > could be loaded". I've tried every namespace I could think of
> > ("java://MyClass", "MyClass", "java:/usr/share/java/MyClass",
> > "MyClass.class", etc.) but none of them work. The class is in the
> > classpath (I even tried compiling and running a little Java program
> > using it and that worked).
> > 
> > Any ideas what I've done wrong?
> > 
> > Cheers,
> > Richard

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.