Smart Matching example

Enable Smart Matching and set Probability to Full. Only source elements that map directly onto the target are mapped. For example:

  • Source document: Sync.SalesOrder
  • Target document: Process SalesOrder

Performing a mapping from these root elements, takes the root element /SyncSalesOrder to /ProcesSalesOrder as a 100% match. As you defined the relative starting context of the initial mapping point.

The children are then mapped where their Xpath matches are 100% and their data types are compatible.

As these BODs are structurally virtually identical with the exception of the verb element. All children which match where the Xpath match is 100% and data types are compatible are mapped automatically.

The two child elements that are not mapped on the first pass are /SyncSalesOrder/DataArea/Sync from the source and /ProcessSalesOrder/DataArea/Process from the target. This is because from the relative context of the starting point of the mapping, the root node level. These Xpath statements are not a 100% match.

Performing an additional mapping from the element /SyncSalesOrder/DataArea/Sync to /ProcessSalesOrder/DataArea/Process sets the relative context of the mapping. It treats the initial mapping point as the set Smart Matching Probability of 100%. The children of this node are mapped. Again, as the structure of these elements within the XSD is virtually identical all children are mapped where there is a 1:1 match. Performing these mappings results in a mapping that contains no error notifications. For example the mapping would produce valid XSLT. There would be warning notifications as all elements in this example are not mapped in the target document. Process.SalesOrder contains the attribute /ProcessSalesOrder/DataArea/Process/@acknowledgeCode which is not present in the /SyncSalesOrder XSD.

To make the mapping warning free and 100% complete, from a target document perspective. You can add a constant value function to the attribute to complete the mapping.