[xsl] Calling a java method in XSL 1.0 with Saxon 6.5.5 fails

Subject: [xsl] Calling a java method in XSL 1.0 with Saxon 6.5.5 fails
From: Kai Hackemesser <kaha@xxxxxx>
Date: Wed, 16 May 2007 08:27:15 +0200
Hi there!

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 :'( ).
This is the class I want to call (the signature is not final, just because I want it running at all now):


public class LineSplitter {

   public static Object splitIntoLines(Object nodes, Object lineLengths) {
       return new String(nodes.getClass().getCanonicalName() + "\n"
               + lineLengths.getClass().getCanonicalName());
   }
}


and this is the template I want to use it with:


   <xsl:template name="splitIntoRows">
       <xsl:param name="nodes"/>
       <xsl:param name="linelengths"/>
       <xsl:value-of select="splitter:splitIntoLines($nodes, $linelengths)"
           xmlns:splitter="java:xxx.xslextension.LineSplitter"/>
   </xsl:template>


While debugging this method in Oxygen Eclipse Plugin I get following error:


Conversion of string to org.w3c.dom.NodeList is not supported

I'm not converting anything as I think. What is going wrong here?

Kind regards,
Kai

Current Thread