Altova MapForce 2022 Basic Edition

XML Schema

MapForce can automatically generate an XML schema based on an existing XML file if the XML Schema is not available. Whenever you add to the mapping area an XML file without a schema (using the menu command Insert | XML Schema/File), the following dialog box appears.


Click Yes to generate the schema. You will then be prompted to select the directory where the generated schema should be saved.


When MapForce generates a schema from an XML file, data types for elements/attributes must be inferred from the XML instance document and may not be exactly what you expect. It is recommended that you check whether the generated schema is an accurate representation of the instance data.


If elements or attributes in more than one namespace are present, MapForce generates a separate XML Schema for each distinct namespace; therefore, multiple files may be created on the disk.


Using DTDs as "Schema" Components

Starting with MapForce 2006 SP2, namespace-aware DTDs are supported for source and target components. To make mappings possible, the namespace-URIs are extracted from the DTD xmlns attribute declarations.


However, some DTDs contain xmlns* attribute declarations without namespace-URIs (for example, DTDs used by StyleVision). Such DTDs have to be extended to make them useable in MapForce. Specifically, you can make such DTDs useable by defining the xmlns-attribute with the namespace-URI, as shown below:


<!ATTLIST fo:root
  xmlns:fo CDATA #FIXED ''


© 2016-2022 Altova GmbH