cancel
Showing results for 
Search instead for 
Did you mean: 

To call java function from Xslt

Former Member
0 Kudos

Hi experts,

I need to call java function from my java class

i know the syntax that how to call an and all... but when i am calling it displaying the error

"do not match any function signature"

my xslt is ::

<?xml version="1.0"?>

<xsl:stylesheet

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

version="1.0"

xmlns:myjava="myjava"

exclude-result-prefixes="myjava">

<xsl:template match="/">

<date>

<xsl:value-of select="myjava:getvalue()"/>

</date>

</xsl:template>

</xsl:stylesheet>

where function name is getvalue()

and class name is  my java.

i just wanted to know that what should be value of  xmlns:myjava ="???".

help me regarding this

thanks

anup banerjee

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi all

I have solved the issue

for this have to check  "use sap xml tool kit "  in operation mapping.

thanks and regards

anup banerjee

aashish_sinha
Active Contributor
0 Kudos

Hi,

Try something like below.

Define the namespace prefix (use Class Name) and bind this prefix to the Java Class object

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

  xmlns:Math="http://www.math.org/">

  <xsl:script implements-prefix="Math" language="java" src="java:java.lang.Math"/>

  ...

</xsl:stylesheet>

Regards

Aashish Sinha

former_member184681
Active Contributor
0 Kudos

Hi,

I believe the namespace should be: xmlns:javamap="java:com.company.group.MappingClass". Refer here for more details: http://help.sap.com/saphelp_nw04/helpdata/en/55/7ef3003fc411d6b1f700508b5d5211/content.htm

Hope this helps,
Greg

Former Member
0 Kudos

hi greg ,

thanks for Your reply

1. now I am able to call java function from xslt  in altova .

      i have imported java class in imported archive.

     but when I am testing it on my operation mapping it displaying error

     java.lang.unsupportedclassversionError

2. what is path coloumn in archive program....

    i dont have any value in path column for java class file.    is it correct...?

rajasekhar_reddy14
Active Contributor
0 Kudos

I think you have not understood the concept clearly

if you are calling any JAVA functions or imported Java packages in XSLT  then you have add import JAVA Exntesnions package sin XSLT code.

refer below example

http://cafeconleche.org/books/xmljava/chapters/ch17s03.html

Regards,

Raj