QuickMap Legacy
QuickMap is a Visual Data Mapper that allows source data to be easily transformed into a desired shape.
*This article is about QuickMap up to version 3.0.0.1. For the current version, see *QuickMap article.
Properties
SourceXml
Type: Xml Input
Provides the source XML that will be transformed.
MappingXml
Type: Xml Input
Holds the internal mapping data that QuickMap uses to render an XSL transform. Clicking this property will open the Visual Data Mapper UI.
XslTransform
Type: Xml Output
Contains the XSL transform that was generated from the visual mapping at time of execution. If required, this transform can be used directly in XSLT Transform where more control is desired over the transformation.
TransformedXml
Type: Xml Output
Contains the transformed XML.
Remarks
QuickMap provides a fast, visual technique for mapping between source and target XML documents. No knowledge of transform language such as XSL is required (although the rendered XSL transform is available via the XslTransform property).
Use of QuickMap involves two steps - providing schemas and mapping between them.
Providing Schemas
QuickMap must be aware of the source and target document schemas in order to present a mapping UI. An XML schema describes the shape of the document including it's fields and their hierarchies.
Schemas must be provided for the source and the target document and can be provided either as XML documents or directly as XML schemas. If an XML document is provided, an XML schema will be inferred whereas, if an XML schema is provided, it will be used directly.
An XML schema document can be placed directly into the Schema tab of the Property Detail Pane (accessed by clicking the edit xml link) or by selecting an appropriate Node Sample. Most Node Samples will set an XML schema or at least a sample XML document.
Provide a schema for the SourceXml Property by:
- providing sample XML directly on the Property or
- placing an XML schema in the Property (by clicking the Schema tab in the Property Detail Pane) or
- connecting the SourceXml Property to a Property on another Node which has an XML Document or XML schema set on it.
Similarly, provide a schema for the TransformedXml Property by:
- providing sample XML directly on the Property or
- placing an XML schema in the Property (by clicking the Schema tab in the Property Detail Pane) or
- connecting the TransformedXml Property to a Property on another Node which has an XML Document or XML schema set on it.
In this example,SourceXmlandTransformedXmlProperties have been wired into their respective sources and targets enabling QuickMap to obtain the schema set on those Properties
Mapping Data
Once the schemas have been provided, clicking the edit mappings link of the Mapping Xml Property will open the Mapping UI in the Property Detail Pane
To create a mapping, either:
- drag from a source field on the left-hand side to a target field on the right-hand side or
- click a source field on the left-hand side and then click a target field on the right-hand side.
An example of a number of source/target field mappings. Note that by mapping the container field (mapped with a light blue line), the correct hierarchy of the child fields is ensured.
Where more complex mapping is required, a mapping expression can be specified using the mapping expression textbox displayed to the right of each target field.
For any target field that contains child fields, the mapping expression, may contain any XSL expression that is valid for the XSL for-each attribute. For any target field that does not contain child fields, the mapping expression may contain any XSL expression that is valid for the XSL value-ofattribute.
Additionally, it is possible to reference a mapped field as a token which will be expanded into an XPath. This is useful where you need to apply a function, such as removing white space or trimming text but can also be used to combine multiple fields together.
For example, if two source fields CustomerCode and CustomerName are mapped to a single target field, the mapping expression could be populated with this function:
concat({FirstName}, ' ', {LastName})
In this example, a first name and surname are concatenated together in the target field.
This example shows how multiple source fields can be mapped to a single target field using a mapping expression.
Examples
See Sample Workflow for an example.