MapForce Command Line Interface

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  Automating Mappings and MapForce >

MapForce Command Line Interface

The general syntax of a MapForce command at the command line is:

 

MapForce.exe <filename> [/{target} [[<outputdir>] [/options]]]

 

Legend

The following notation is used to indicate command line syntax:

 

Notation

Description

Text without brackets or braces

Items you must type as shown

<Text inside angle brackets>

Placeholder for which you must supply a value

[Text inside square brackets]

Optional items

{Text inside braces}

Set of required items; choose one

Vertical bar (|)

Separator for mutually exclusive items; choose one

Ellipsis (...)

Items that can be repeated

 

<filename>

The mapping design (.mfd) file from which code is to be generated.

 

/{target}

Specifies the target language or environment for which code is to be generated. The following code generation targets are supported.

 

Target

Description

/XSLT

Generates XSLT 1.0 code.

/XSLT2

Generates XSLT 2.0 code.

 

<outputdir>

Optional parameter which specifies the output directory. If an output path is not supplied, the current working directory will be used. Note that any relative file paths are relative to the current working directory.

 

/options

The /options are not mutually exclusive. One or more of the following options can be set.

 

Option

Description

/GLOBALRESOURCEFILE <filename>

This option is applicable if the mapping uses Global Resources to resolve input or output file or folder paths, or databases. For more information, see Altova Global Resources.

 

The option /GLOBALRESOURCEFILE specifies the path to a Global Resource .xml file. Note that, if /GLOBALRESOURCEFILE is set, then /GLOBALRESOURCECONFIG must also be set.

/GLOBALRESOURCECONFIG <config>

This option specifies the name of the Global Resource configuration (see also the previous option). Note that, if /GLOBALRESOURCEFILE is set, then /GLOBALRESOURCECONFIG must also be set.

/LOG <logfilename>

Generates a log file at the specified path. <logfilename> can be a full path name, for example, it can include both a directory and a file name. However, if a full path is supplied, the directory must exist for the log file to be generated. If you specify only the file name, then the file will be placed in the current directory of the Windows command prompt.

 

Remarks

Relative paths are relative to the working directory, which is the current directory of the application calling MapForce. This applies to the path of the .mfd filename, output directory, log filename, and global resource filename.
Do not use the end backslash and closing quote at the command line (for example, "C:\My directory\"). These two characters are interpreted by the command line parser as a literal double quotation mark. Use the double backslash \\ if spaces occur in the command line and you need the quotes ("c:\My Directory\\"), or try to avoid using spaces and therefore quotes at all.

 

Examples

1) To start MapForce and open the mapping <filename>.mfd, use:

 

MapForce.exe <filename>.mfd

 

2) To generate XSLT 2.0 code and also create a log file with the name <logfilename>, use:

 

MapForce.exe <filename>.mfd /XSLT2 <outputdir> /LOG <logfilename>

 

3) To generate XSLT 2.0 code taking into account the global resource configuration <grconfigname> from the global resource file <grfilename>, use:

 

Mapforce.exe <filename>.mfd /XSLT2 <outputdir> /GLOBALRESOURCEFILE <grfilename> /GLOBALRESOURCECONFIG <grconfigname>


© 2019 Altova GmbH