I have a Java method with variable argument which I need to call from XSLT (1.0). But it doesn't work, it keeps failing with the following error:
javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet
However, if I expand the variable argument, it works!
Example:
public static String getValue(String key, String... args) { // this is what I want, but doesn't work
public static String getValue(String key, String args1) { // this works
public static String getValue(String key, String args1, String args2) { // this works
In XSLT:
<xsl:value-of select="myjavaclass:getValue('MyKey','Arg1')"/>
<xsl:value-of select="myjavaclass:getValue('MyKey','Arg1','Arg2')"/>
So, does anyone know if I can use Java method with variable argument in XSLT? I hope I don't have to create different methods for each number of argument.
Thank you much!