| Recipes by Topic | Recipes by Author | Request Enhancement | Report a bug | Fix documentation |
Kamlesh Zanje |
---|
Writing reflexive extension functions in Java to be invoked from XSLT Mappings.
Download the integration flow Sample
Step | Code | Why? |
---|---|---|
Extensibility capability - Java function call | <xsl:template match="/" xmlns:date="java:java.util.Date"> <xsl:value-of select="date:new()"/> </xsl:template> |
Writing reflexive extension functions in Java |
- SAP Help - Create XSLT Mapping
- Cloud Platform Integration – XSLT Mapping is enriched with XSLT 3.0 specification
- What is new in XSLT 3.0
The integration flow depicted in the recipe is very simple which contains start timer and XSLT Mapping step through which we can leverage the invocation of java function call from XSLT script.
This is the script used in the sample integration flow which starts with namespace declaration and then invokes the java function which display the current date.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/"
xmlns:date="java:java.util.Date">
<xsl:value-of select="date:new()"/>
</xsl:template>
</xsl:stylesheet>
Output of the Java function invocation from the XSLT script can be experienced in the Monitor's message processing view.