So, now I understand I don't need to re-compile Saxon source just to add in extensions.
SO I tried a dirt simple example.
Code:
package com.fujitsu.fnc.swda.extensions;
public class functions {
/**
* constructor
*/
private functions () {
}
/**
* test function
* @return
*/
public static int test() {
return 35;
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(test());
}
}
I copied the resulting .class file to my CLASSPATH
and I used this to call it:
Code:
<xsl:text>#x0A;</xsl:text>
<xsl:text>Testing Processor Extensions</xsl:text>
<xsl:text>#x0A;</xsl:text>
<xsl:value-of select="swda:test()" xmlns:swda="java:com.fujitsu.fnc.swda.extensions.functions">
</xsl:value-of>
Only I get a
Quote:
quote:SystemID: D:\mphare\Development\XMLTesting\extensions\test.x sl
Location: 20:0
Description: XPath syntax error at char 11 on line 20 in {swda:test()}:
Cannot find a matching 0-argument function named {java:com.fujitsu.fnc.swda.extensions.functions}te st()
URL: http://www.w3.org/TR/xpath20/#ERRXPST0003
|
message instead of a nice '35' output.
I know I've missed something very fundamental, can anyone help me see the light?
Thanks,
- m
------------------------
GnuPG Key fingerprint = 1AD4 726D E359 A31D 05BF ACE5 CA93 7AD5 D8E3 A876
Michael Hare