SourceID Processing Instructions in Generic XML

?SourceID? instructions must be placed inside repeated scope. Only one ?SourceID? is allowed for each scope.

  • <?SourceID?> is used to extract the identifier for a repeated element when the identifier is a nested element.
  • [?SourceID?] is used to extract the identifier for a repeated element when the identifier is an attribute.

The following is an example of an input document that requires the repeated node and ID source declarations to happen on different nodes:

Copy
<Products>
   <Product ID="EXA-5002-1004">
      <Attributes>
        <Attribute>
          <ID>52</ID>
          <Value>Some description text</Value>
         </Attribute>
        <Attribute>
          <ID>77</ID>
          <Value>53 kg</Value>
        </Attribute>
      </Attributes>
   </Product>
</Products>    

The following is a Generic XML template for processing the input document:

Copy
<Products>
   <Product ID="[?Source?]">
   <?Record?>
      <Values>
         <Value AttributeID="[?SourceID?]">
         <?Repeated?>
         <?Source?>
         </Value>
      </Values>
    </Product>
</Products>    

When used on the input document, this template outputs the fields 'ID', 'Value-52', 'Value-77.' In this case, the subtree from 'Value' and down is said to be in repeated scope.

The Generic XML template this time extracts the sourceID from a node value. Follow the proceeding steps and use the following template to extract the input document:

  1. Copy the above Generic XML to a new file, and save as an XML file.
  2. Open Import Manager, select the file as the Data Source Filename, and click 'Next.'
  3. Enter or paste the template below in the Import Manager, and generate a conversion preview by clicking the refresh button, .
Copy
<Products>
   <Product ID="[?Source?]">
   <?Record?>
   <Attributes>
     <Attribute>
       <?Repeated?>
       <ID><?SourceID?></ID>
       <Value><?Source?></Value>
      </Attribute>
   </Attributes>
      </Product>
</Products>    

For the input document, this template generates the fields ID, 52.Value and 77.Value.