MAPexpressions.xml Example

The following example illustrates the currentDateTime extension function.

Syntax

<Function name="DateTimeFunctions.currentDateTime" type="DATE">

<Extension library="com.sybase.ebd.eai.xsl.extensions" prefix="syexts"/>

<Argument name="date-format" type="STRING" minOccurs="1" maxOccurs="1"/>

</Function>

Requirements for Referencing a Java Method

For each exposed Java method, you must have one Function element. For each Function element, you must have one Extension element to reference the Java package, and for each input parameter in the Java method, you must have one Argument element.

Use the following table to determine how the Function element and its children, the Extension and Argument elements and their attributes reference the Java class.

Element Type

Attribute

Description

Function

name

Name of the Java class and method.

Example: DateTimeFunctions.CurrentDateTime

Function

type

Datatype of the return value for XSL (not of the Java method).

Extension

library

Fully qualified name of the Java package where the class resides.

Extension

prefix

Namespace prefix for the Java package. You must have one per package, and it must have a unique name.

Argument

name

Name of the argument that displays in the Transformation Rule Builder expression.

Argument

type

Datatype of the argument.

Argument

minOccurs

Minimum number of occurrences of the argument. The node lists the minimum size.

Argument

maxOccurs

Maximum number of occurrences of the argument. The node lists the maximum size.