Skip to main content Skip to complementary content

Reading from multiple files

Create a structure that reads from different files.

Before you begin

  • You have two different files to read from.
  • You have created a structure for each file.

About this task

In this example, you want to create a structure that combines two different structure, each reading from a specific file. You can use the following XML samples, containing respectively customer and order information:
<customers>
  <customer>
    <customerId>IRloRH6F9fNnYXl</customerId>
    <lastName>Thomas</lastName>
    <firstName>Carter</firstName>
    <address>
      <street>Camelback Rd</street>
      <city>Augusta</city>
      <state>Minnesota</state>
    </address>
  </customer>
</customers>
<orders>
  <order>
    <orderId>KTCZqmBqAW4VvzB</orderId>
    <customerId>IRloRH6F9fNnYXl</customerId>
    <items>
      <item>115</item>
      <item>23</item>
      <item>67</item>
      <item>29</item>
      <item>177</item>
    </items>
  </order>
</orders>

Procedure

  1. Once you have created the two separate structures, named customers and orders for example, create a new empty structure with an XML representation.
  2. Create a root element, then create a customers child element.
  3. In the customers element, click the ... button to the right of Inherits From and select the relevant structure.

    Example

  4. Drag and drop a ReadURL function in the IO/Database tab of the customers element.
  5. Double-click ReadURL to define its properties:

    Example

    Property Value
    Representation XML
    URL URL to the file to read from, file:///c:/users/jsmith/documents/customers.xml for example.
  6. Right-click the root element to create a new orders child element.
  7. Repeat previous steps to configure the orders element to inherit from the relevant structure.
  8. Drag and drop a ReadURL function in the IO/Database tab of the orders element and define its properties.

    Example

    Property Value
    Representation XML
    URL URL to the file to read from, file:///c:/users/jsmith/documents/orders.xml for example.

Results

Your structure is created and configured to read from two different XML files, you can now use it in a map.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!