Showing results for 
Search instead for 
Did you mean: 

Error: Illegal number of arguments passsed to the function call

0 Kudos

HI All,

In our scenario we are using XSLT mapping with java enhancement.Its working fine in Stylus studio but when the same is imported into XI its throwing the below mentioned error:

javax.xml.transform.TransformerException: Illegal number of arguments or types of arguments in a call of function 'Trans:Convert'.

Our requirement is that we are summing up the field "Grant_Amount" which occurs multiple times in the source structure and the sum is mapped to the field "Sum' on the target side.The stylesheet is working fine in stylus studio but whe imported into XI the above mentioned error is being thrown.Can any one one please help me solving this issue.

The XSL, the source XMLand the java class are mentioned below:




<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="" xmlns:a="" xmlns:Trans="">

<xsl:template match="/">





<xsl:value-of select="Trans:Convert(//Grant_Amount)"/>












<?xml version="1.0" encoding="UTF-8"?>

<ns0:MT_SourceXSLJava xmlns:ns0="">













Java Code:



public class String2Number


public static double Convert(String[] a)


double sum=0;

String[] temp = new String100;

for(int i=0;i<a.length;i++)


temp = (a).replaceAll(",






return sum;



Please guide me to the right solution.

Thanks and Regards,


Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

If you are using below mentioned java code for Convert method, then see you are passing a String Array, but in below statement:

<xsl:value-of select="Trans:Convert(//Grant_Amount)"/>

This is just a single value i think, you have to pass an array with values 100,200,300. Pls check it.