When mapping XML elements, you may want to perform an action that is not provided by a standard XSLT function. One option is to use a custom Java bean. This topic uses an example to show how to call a method that is defined in your own custom Java bean.
Consider the following map in the XML mapping editor. We want to place the value of customerIDFloatAttr, an element of type float, into customerIDAttr, an element of type string. Since the target element's type is string, we need to convert the float to a string. We will do so by calling the floatToString method that is defined in the BeanTypeConverter Java class, and passing the float value as an argument to the method. The resulting string will be placed into the customerIDAttr element.
<xsl:variable name="var0_floatToString" select="user0:floatToString(/body/getQuote/inputGetQuote/@customerIDFloatAttr)"/> <xsl:if test="@customerIDFloatAttr"> <xsl:attribute name="customerIDFloatAttr"> <xsl:value-of select="@customerIDFloatAttr"/> </xsl:attribute> </xsl:if> <xsl:attribute name="customerIDAttr"> <xsl:value-of select="$var0_floatToString"/> </xsl:attribute>