Using standard connections on mixed content items

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  Designing Mappings > Connection Types > Source-driven connections >

Using standard connections on mixed content items

As mentioned before, source-driven (not standard) connections are normally used when mapping data from mixed content nodes. Otherwise, the resulting output may be undesirable. To see the consequences of using a standard (target-driven) connection when mapping data from a mixed content node, follow the steps below:

 

1.Open the mapping Tut-OrgChart.mfd from the <Documents>\Altova\MapForce2019\MapForceExamples\Tutorial\ folder.
2.Create a connection between the para node in the source and the para node in the target. A message appears, asking if you would like MapForce to define the connections as source-driven. Click No (this disregards the MapForce suggestion and creates a standard connection).

mix-std-1

Note:Make sure that the connection is standard (target-driven), as shown above. If a Copy-All connection is created automatically, right-click the connection, and select Target Driven (Standard) from the context menu.

 

3.Click the Output tab to see the result of the mapping.

mix-std-2

 

As illustrated above, mapping mixed content nodes using standard connections produces the following result:

 

The content of the text() source item is copied to the target; however, the sequence of child nodes (bold and italic, in this case) in the output corresponds to the sequence in the target XML schema. In other words, the child nodes (bold and italic, in this case) appear after the mixed content node text.
For each para element, MapForce has mapped the text() node first, then all bold items, and, finally, all italic items. As a result, multiple bold and italic items appear stacked on each other. Note that the content of each item is mapped if a connection exists to it from the source.

© 2019 Altova GmbH