Please enable JavaScript to view this site.

Altova MapForce 2020 Basic Edition

If you generate code from mappings,  the generated files are no longer run by MapForce. Instead, the mappings are run by the target environment you have chosen (for example, RaptorXML Server). The implication is that, for the mapping to run successfully, any relative paths must be meaningful in the environment where the mapping runs.

 

Consequently, when the mapping uses relative paths to instance or schema files, consider the base path to be as follows for each target language:

 

Target language

Base path

XSLT/XSLT2

Path of the XSLT file.

XQuery*

Path of the XQuery file.

C++, C#, Java*

Working directory of the generated application.

BUILT-IN* (when previewing the mapping in MapForce)

Path of the mapping (.mfd) file.

BUILT-IN* (when running the mapping with MapForce Server)

The current working directory.

BUILT-IN* (when running the mapping with MapForce Server under FlowForce Server control)

The working directory of the job or the working directory of FlowForce Server.

* Languages available in MapForce Professional and Enterprise editions

If required, you can instruct MapForce to convert all paths from relative to absolute when generating code for a mapping. This option might be useful if you run the mapping code on the same operating system, or perhaps on another operating system where any absolute path references used by the mapping can still be resolved.

 

To convert all paths to absolute in the generated code:

 

1.Right-click an empty area on the mapping. The Mapping Settings dialog box appears.

2.Select the Make paths absolute in generated code check box.

 

When you generate code and the check box is selected, MapForce resolves any relative paths based on the directory of the mapping file (.mfd), and makes them absolute in the generated code. This setting affects the path of the following files:

 

Input and output instance files for all file-based component kinds

 

When the check box is not selected, the file paths will be preserved as they are defined in the component settings.

 

Library paths in generated code

Mapping files may optionally contain path references to libraries of various kinds. For example, a mapping file may import user-defined functions from another mapping file, or functions from custom XSLT, XQuery*, C#*, or Java* libraries, or functions from .mff* (MapForce Function) files, see also Managing Function Libraries.

 

* Features available in MapForce Professional and Enterprise editions

 

Importantly, the option Make paths absolute in generated code applies only to mapping components, and it does not affect paths to external libraries. Instead, for all libraries other than XSLT and XQuery, the library path will be resolved and converted to an absolute path in generated code. For example, if your mapping file contains library references such as .NET .dll or Java .class files, and if you want to run the generated code in some other environment (perhaps, on another computer), then the referenced libraries must exist at the same path in the target environment.

 

If you plan to generate an XSLT or XQuery file from a mapping, you can make the library path relative to the generated XSLT or XQuery file, as follows:

 

1.Right-click an empty area on the mapping. The Mapping Settings dialog box appears.

2.Select the check box Reference libraries with paths relative to generated XSLT / XQuery file.

 

If you select the check box above, make sure that the XSLT or XQuery library file actually exists at that path.

 

To make the path to the XSLT or XQuery library file absolute in generated code, clear the check box.

© 2020 Altova GmbH