![]() |
| Previous Top Next |
Functions and libraries |
The Libraries pane displays the available libraries for the currently selected programming language, as well as the individual functions of each library. Functions can be directly dragged into the Mapping tab. Once you do this, they become function components.

The standard core, lang, xpath2 and xslt libraries are always loaded when you start MapForce, and do not need to be added by the user. The Core library is a collection of functions that can be used to produce all types of output: XSLT, XQuery, Java, C#, C++,. The other libraries (XSLT, XSLT2, XPath2, Lang etc.) contain functions associated with each separate type of output.
Please note:
The XPath 2.0 library and its functions, are common to both XSLT 2.0 and XQuery languages
Selecting:
XSLT, enables the core and XSLT functions (XPath 1.0 and XSLT 1.0 functions).
XSLT2, enables the core, XPath 2.0, and XSLT 2.0 functions.
XQ(uery), enables the core and XPath 2.0 functions.
XPath 2.0 restrictions:
Several XPath 2.0 functions dealing with sequences are currently not available.
To use a function in Mapping window:
| 1. | First select the programming language you intend to generate code for, by clicking one of the output icons in the title bar: XSLT/XSLT2 XQ, Java, C#, or C++. |
The functions associated with that language are now visible in the Libraries window. The expand and contract icons show, or hide the functions of that library.
| 2. | Click the function name and drag it into the Mapping window. |
| 3. | Use drag and drop to connect the input and output parameters to the various icons. |
Note that placing the mouse pointer over the "result = xxx" expression in the library pane, displays a ToolTip describing the function in greater detail.
Function tooltips:
Explanatory text (visible in the libraries pane) on individual functions, can be toggled on/off by clicking the "Show tips" icon
in the title bar. Placing the mouse pointer over a function header, displays the information on that function.

To add new function libraries:
MapForce allows you to create and integrate your own function libraries, please see the sections: Adding custom function libraries, Adding custom XSLT 1.0 functions, Adding custom XSLT 2.0 functions and User-defined functions for more information.
Please note:
custom functions/libraries can be defined for Java, C#, and C++, as well as for XSLT and XSLT 2.
Extendable functions
Several functions available in the function libraries are extendable: for e.g. the concat, "logical-and", "logical-or" functions. The parameters of these types of function can be inserted/appended and deleted at will. Clicking the "plus" icon inserts or appends the same type of parameter, while clicking the check mark deletes the parameter.
Please note: "dropping" a connector on the "plus" symbol, automatically inserts/appends the parameter and connects it.

|