Introduction to code generator このトピックを印刷 前のページ 1つ上のレベル 次のページ

ホーム >  Code Generator >

Introduction to code generator


The primary goal of the generated code is to execute a MapForce mapping. In addition to this, you can optionally generate schema wrapper libraries for XML schemas used by the mapping, which enables you to read or write data to/from XML instances.


The generated code is expressed in C++, Java or C# programming languages.


Target Language




Development environments

Microsoft Visual Studio 2008, 2010, 2013, 2015, 2017

Microsoft Visual Studio 2008, 2010, 2013, 2015, 2017

Java 1.7 or later

Eclipse 4.4 or later

Apache Ant (build.xml file)

XML DOM implementations


Apache Xerces 3



Database API






You can configure whether the C++ generated output should use MSXML 6.0 or Apache Xerces 3. MapForce generates complete project (.vcproj) and solution (.sln) files for all supported versions of Visual Studio (see table above). The generated code optionally supports MFC.


Note:When building C++ code for Visual Studio and using a Xerces library precompiled for Visual C++, a compiler setting has to be changed in all projects of the solution:


1.Select all projects in the Solution Explorer.
2.On the Project menu, click Properties.
3.Click Configuration Properties | C/C++ | Language.
4.In the list of configurations, select All Configurations.
5.Change Treat wchar_t as Built-in Type to No (/Zc:wchar_t-)



The generated C# code uses the .NET XML classes (System.Xml) and can be used from any .NET capable programming language, such as VB.NET, Managed C++, or J#. Project files can be generated for all supported versions of Visual Studio (see table above).



The generated Java output is written against the industry-standard Java API for XML Processing (JAXP) and includes an Ant build file and project files for supported versions of Java and Eclipse (see table above).


Generated output

The designated destination folder will include all the libraries and files required to execute the mapping, namely:


A variable number of Altova libraries required by the mapping (for example, Altova function libraries, database libraries, EDI libraries)
A complete mapping application. When compiled and run, the application performs the mapping transformation.


Code generator templates

Output code is completely customizable via a simple yet powerful template language (SPL, from Spy Programming Language) which gives full control in mapping XML Schema built-in data-types to the primitive datatypes of a particular programming language. SPL allows you to easily replace the underlying parsing and validating engine, customize code according to your company's writing conventions, or use different base libraries such as the Microsoft Foundation Classes (MFC) and the Standard Template Library (STL).

(C) 2019 Altova GmbH