A document type definition (DTD) file indicates that an element repeats by using a plus sign (+) or an asterisk (*) after the element name. The symbols display in the Business Connect XML mapping utility as well. Some XML specifications place significance on data in repeating groups, and you need to map each piece of data sent in the repeating group.
Because a repeating group is indicated in the DTD only once, it can be difficult to map data from each repetition of the element. Use the mapping utility to duplicate the element within a repeating group to make mapping the repeating information clearer.
For example, your trading partner sends you an XML document that contains a repeating element called Partner. Your XML specifications indicate that the Partner element occurs three times in the XML document they send. Each repetition of the Partner element defines different required data, as shown in the following example:
<Partner>
<PartnerType> Includes Bill-to data
<PartnerID>
<Partner>
<PartnerType> Includes Ship-to data
<PartnerID>
<Partner>
<PartnerType> Includes Buyer data
<PartnerID>
When you create the transaction map for the repeating group, the Partner and its children occur only once in the DTD, but you need to map and save all three pieces of data. Duplicate the element in the mapping utility so you have three instances from which to map.
To pull only one piece of data from a repeating group, use a logical expression to modify the XML data.
To duplicate XML elements for repeating groups:
Right-click a transaction in the Trading Partner Tree and select Edit Transaction Map to display the transaction map.
Click the tab to display the map in which you want to duplicate an element.
In the source or target DTD, depending on the map you have displayed, select the element to duplicate.
Right-click the element and select Duplicate this Node.
The system duplicates the entire element. You can also duplicate children within a node. Each duplicated element displays with a gray highlight.
Map the element, as needed.
If your XML specification indicates that each instance of a repeating group is required, map all instances of the repeating groups.
From the File menu, select Save Transaction Map to save the map.
See Also: