XML Mapping

XML mapping in Altova MapForce

Altova MapForce® 2014 provides powerful, visual XML mapping functionality for instantly transforming XML data from one XML format to any other XML format based on XML Schema or namespace aware DTDs, and can even generate an XML mapping component from an XML instance file.

Download Trial

Developing XML Mappings

MapForce includes an intuitive graphical interface for defining and executing XML mappings based on XML Schema or DTD content models. To develop an XML mapping, simply load two or more schemas into MapForce and drag connecting lines between the nodes of the source and target, as shown above. Mixed content support even enables you to map text data that is interspersed with XML.

An optional MapForce setting automatically connects matching child elements as you create your XML mapping.

If you do not have an associated schema for an XML instance document, MapForce generates an example XML Schema for the XML mapping.

MapForce supports advanced XML transformations between multiple input and multiple output schemas, multiple source and/or target files, or advanced multi-pass data transformations (from schema, to schema, to schema, etc.)

XSLT & XQuery

Once you have finished defining your XML mapping and data processing rules, you can load an XML instance document as a source file, and the MapForce Built-In Execution Engine will instantly convert the data into the new format.

MapForce also autogenerates XSLT 1.0 or 2.0 stylesheets for use in transforming data in multiple XML documents based on the source schema to conform to the target XML Schema.

The ability to generate XQuery code allows you work with XQuery natively, with MapForce acting as a visual XQuery builder. The XQuery code that MapForce produces based on your XML mapping can be executed in an XML-capable database, or you can view the results of an XQuery by simply clicking the Output tab.

XML Mapping Features:

  • Drag-and-drop mapping between components
  • Supports XML Schema and DTD content models
  • Generates XML Schema from instance document
  • XSLT 1.0/2.0 Function Libraries and advanced data processing functions
  • XML Digital Signature support
  • Support for XML wildcards (xs:any and xs:anyAttribute)
  • Support for comments and processing instructions in output XML
  • Generates XSLT 1.0/2.0 stylesheets or Java, C++, or C# source code
MapForce mapping of an XML wildcard

Support for XML Wildcards

The <xs:any> element and <xs:anyAttribute> in an XML Schema design allow any new element or attribute to be placed at the corresponding location in an XML instance document, even though the new element or attribute is not defined in the XML Schema. This is known as an XML wildcard and it is a popular mechanism used to allow a degree of customization in many XML Schemas that support industry standards across a wide variety of businesses.

MapForce supports <xs:any> and <xs:anyAttribute> for mapping to output in XML or any other output format. A new selection button next to <xs:any> or <xs:anyAttribute> in an XML mapping input component opens a wildcard selection dialog.

The screenshot at the left shows the <xs:any> element the gpx.xsd XML Schema we described in the Altova Blog series of posts on mapping XML data recorded by GPS devices. The Wildcard Selections dialog enables mapping of extensions included with each <trackpoint> recorded by a vehicle GPS.

The <xs:any> element, as well as <xs:anyAttribute>, are commonly used in XML Schema design and support in MapForce has been a frequent user request.

Viewing XML Mapping Output

As you design an XML mapping project, the built-in MapForce Engine allows you to view and save the autogenerated XSLT 1.0/2.0 or XQuery code with one click. You can also click the Output tab to view the actual output generated by your XML mapping.

XML mapping output in Altova MapForce

Automating XML Mappings

In addition to XSLT 1.0 and 2.0 stylesheets and XQuery code, MapForce generates Java, C++, and C# program code for converting data from the source to the target content model as defined in your XML mapping.

You can also deploy mappings to FlowForce Server for enterprise workflow automation.

Advanced Functionality

In addition to XML mapping, MapForce supports mapping any combination of XML, database, flat file, EDI, Excel (OOXML), XBRL, and Web services data to build data integration or Web services applications.

MapForce is powered by RaptorXML for lightning-fast XSLT and XQuery processing. RaptorXML is also available as a cross-platform server product.