Skip to Content
0
Former Member
Mar 22, 2006 at 11:27 AM

How to use standard java functions in a XSLT mapping

634 Views

Hi All,

I wish to use a standard java function in a XSLT mapping, The issue is either i am giving incorrect namespace which is used to invoke the function or the signature of the function call is incorrect, I have read all the links in http://help.sap.com, and i know one can enhance a XSLT mapping by writing one's own java code and thereby using java standard functions , but the requirement is such that i need to try and use java standard function in XSLT mapping itself.

Please refer to the sample code below:

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

<xsl:stylesheet version="1.0"

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

xmlns:javamap="java:java.lang.String">

<xsl:output method="text"/>

<xsl:template match="/">

<xsl:variable name="input" select="Title">

<xsl:if test="function-available('javamap:toUpperCase')">

<xsl:value-of select="javamap:toUpperCase($input)"/>

</xsl:if>

Author:<xsl:value-of select="Author"/>

</xsl:template>

</xsl:stylesheet>

error encountered is: Illegal number or type of arguments.

please reply if you have tried a similar scenario in SAP XI.

Thanks & Regards,

Varun