I'm having trouble to call an external java function in my XSL code with Xalan processor.
The error I get is :
Exception in thread "main" java.lang.RuntimeException: java.lang.NoSuchMethodException: For extension function, could not find method org.apache.xml.utils.NodeVector.incrementPropertyId([ExpressionContext,] ).
I have a java class named Util.java in the folder where I execute my compile command.
In my xsl file, I've declared my namespace as follow :
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:java="http://xml.apache.org/xslt/java" exclude-result-prefixes="java"
xmlns:util="xalan://Util">
And I call my function using :
<xsl:copy-of select="util:incrementPropertyId(blablabal)"/>
So I suppose my problem comes from my namespace, but what is wrong with it ?
Also, It's a xsl 1.0 stylesheet.
Thanks for your help
Edit :
In my Util.java file, I have no package declared since I'm at the root... should I add a package Util; definition to my class ?
define your name space util in the extension-element-prefix, and assign to this namespace the package and the name of your class:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:java="http://xml.apache.org/xslt/java" exclude-result-prefixes="java"
extension-element-prefix="util"
xmlns:util="your.package.YourClass">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With