Altova MapForce 2025 Professional Edition

Import Custom XQuery 1.0 Functions

Home Prev Top Next

When XQuery is selected as mapping transformation language, MapForce displays the built-in function libraries available for XQuery in the Libraries window. If necessary, you can extend this list with custom XQuery functions, by importing custom XQuery 1.0 library modules into MapForce.

 

To be eligible for import into MapForce, an XQuery file must satisfy the following requirements:

 

It must be a valid library module according to XQuery specification. In other words, it must start with a module declaration such as module namespace <prefix>="<namespace name"

All functions declared in the imported library module must return atomic data types (for example, xs:string, xs:boolean, xs:integer, etc). Function parameters must also have atomic types.

To import an XQuery library module:

1.Click the Add/Remove Libraries button at the bottom of the Libraries window. The Manage Libraries window opens (see screenshot below).

mf_manage_libraries_window_empty

2.To import functions as a local library (in the scope of the current document only), click Add under the current mapping name. To import functions as a global library (at program level), click Add next to Global Library Imports. When you import a library locally, you can set the path of the library file to be relative to the mapping file. With globally imported libraries, the path of the imported library is always absolute.

 

3.Browse for the .xq or .xquery library file, and click Open.

 

The imported library modules appear in the Libraries window, and then you can drag specific functions into the mapping area and use them like any other MapForce function component, see also Add a Function to the Mapping.

 

If you do not see the imported XQuery library module, make sure that XQuery is selected as a transformation language.

 

See also:

XQuery engine implementation

© 2018-2024 Altova GmbH