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

Re: Calling a java method in XSL 1.0 with Saxon 6.5.5

Subject: Re: Calling a java method in XSL 1.0 with Saxon 6.5.5 fails
From: Kai Hackemesser <kaha@xxxxxx>
Date: Wed, 16 May 2007 10:56:57 +0200
Re:  Calling a java method in XSL 1.0 with Saxon 6.5.5
Michael Kay schrieb:
I have a (currently) simple java method I want to use in a xsl stylesheet. I use XSL 1.0 and Saxon 6.5.5 (project requirement :'( ).

Please tell whoever it is that sets your project requirements that Saxon
6.5.5 is getting rather old, that its developer no longer remembers very
much about how it works, and that Saxon 8.9.0.3 handles XSLT 1.0 stylesheets
just as well if not better, unless you use one of the very few pathological
constructs where the specification changes incompatibly in XSLT 2.0.
The requirements are: It has to run with pure JDK 1.4.2 and there it is used, isn't it?
In meantime somehow I gut success avoiding this error message, don't ask, how. (Trying this and that ...)
Now I get a new problem: My java method should return a NodeList or something like that. I haven't found the Node implementation class to avoid that error:


Supplied NodeList contains non-Saxon DOM Nodes

The return values represents a String array or something alike.

Do you have a tip?

Ciao!
Kai

However, I've opened up the source code for the first time in many months,
to see what exactly the message means. As far as I can see, you can only get
this message if the supplied type of one of the arguments to the extension
function is an XPath string, and the declared type of the parameter in the
Java method is org.w3.dom.NodeList.

Is it possible that it's trying to call a different version of your method?
It looks to me as if the version you've shown us is essentially a diagnostic
method that's simply there to display the types of the arguments it has been
given. This isn't actually a very effective diagnostic in the first place,
because the conversions that Saxon performs will depend on the declared
types of the parameters to the method. My theory is that you had a different
version of the method before you wrote the diagnostic version, and it's that
that's being called.

Michael Kay
http://www.saxonica.com/

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.