Source Processing Instructions in Generic XML

To extract the content of an XML element as a field, place a <?Source [OptionalIdentifier]?> processing instruction within the <?Record?> scope of the template. By default, the heading (column) name of a field is the name of the surrounding parent node.

Copy
<Products>
   <Product>
     <?Record?>
     <Name><?Source?></Name>
     <Text><?Source Description?></Text>
    </Product>
</Products>

In the above example, each product hierarchy encountered exports a row with data for the columns Name and Description.

To make the mapping step easier, use your own identifiers by defining an optional identifier. As shown in the <Text> instruction in the above example, the Text field will display with a heading of 'Description' since the optional identifier was used within the source tag. The optional identifier displays in the Map Data step.

You can also extract the value of an attribute by using the [?Source [Optional Identifier]?] instruction as follows:

Copy
<Products>
   <Product Name="[?Source?]" Text="[?Source Description?]">
   <?Record?>
   </Product>
</Products>    

Preventing Duplicate Field Names

Fields extracted using the <?Source?> and <?MultiSource?> instructions can sometimes have the same names, either because of identical tag or attribute names, or because of duplication of names explicitly chosen by the template creator. In this situation, the Import Manager ensures that all field names are unique by adding a post-fix of the form (n), where n is the first integer >= 2 for which the combined field name is not already in use.

If a repeated scope contains multiple <?Source?> or <?MultiSource?> instructions, and one of them results in a name duplication, only that field will be renamed.

Note: Resolve name collisions by providing explicit, non-duplicating names.