XSLT on external function with SAXON PE-9.5
Posted: Sat Nov 09, 2013 2:46 am
Hi,
Oxygen 15.3 with student license on MacOS Lion.
I'm experimenting with xslt with external functions, I followed the documentation on reflexive functions and I create a very simple class:
I packaged it in a .jar, that was verified by using it in another class, and created a simple .xslt to call it:
I created a transformation scenario with Saxon PE 9.5.1.2 as engine and added my jar as an extension, however, the editor gives me the error:
When I run the transformation, same error. I tried adding a validation scenario, but still, the same error. Calling standard java functions work. I also verified that extensions are activated in the preferences.
Any hint?
Best Regards,
Luis
Oxygen 15.3 with student license on MacOS Lion.
I'm experimenting with xslt with external functions, I followed the documentation on reflexive functions and I create a very simple class:
Code: Select all
package prueba;
public class Saludo {
public static String hola(){
return "Hola";
}
}
Code: Select all
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
version="2.0">
<xsl:output indent="yes" method="xml" />
<xsl:template match="data/element">
<elemento>
<prueba>
<xsl:value-of select="saludo:hola()" xmlns:saludo="java:prueba.Saludo" />
</prueba>
</elemento>
</xsl:template>
Code: Select all
XPST0017 XPath syntax error at char 0 on line 27 in {saludo:hola()}: Cannot find a matching 0-argument function named {java:prueba.Saludo}hola(). For diagnostics on calls to Java methods, use the -TJ command line option or set the Configuration property FeatureKeys.TRACE_EXTERNAL_FUNCTIONS
Any hint?
Best Regards,
Luis