Read Large XML Files Containing Multiple Namespaces

You can use a stage file action to read a large XML file that contains multiple namespaces. You upload a ZIP archive file containing the contents. While this use case describes how to use the FTP Adapter with the stage file action, other adapters can receive an XML document as an attachment in the response (for example, the SOAP Adapter, REST Adapter, and Oracle Taleo Enterprise Edition Adapter).

The following XML example shows an export of a candidates list obtained from Oracle Taleo Enterprise Edition. The XML file includes a repeating structure and contains more than one namespace in the document.


XML file with repeating structure and multiple namespaces

This use case provides a high-level overview of the steps to read a large XML file with multiple namespaces in segments in an integration. Two FTP Adapters are used to download a large ZIP file from a remote FTP server and write the staging file to a remote FTP server.

  1. Add an FTP Adapter to a schedule integration.
  2. Configure the FTP Adapter with the Download File operation and specify the input directory, file name, and ZIP file download directory.
    The Cancel and Done buttons appear in the upper right. Below is a summary of the wizard pages. A previous page link, Basic Info link, Operations link, Schema link, File Contents Definition link, Summary link, and Next page link are displayed. The Operations link is selected. Below are the Select Operation list (Download File is selected), Select a Transfer Mode list (ASCII and Binary (which is selected) appear, Input Directory field, File Name field, and Download Directory field.

  3. Add a stage file action to the integration and configure it as follows:
    1. On the Configure Operation page, configure the following options:
      • Select Read File in Segments from the Choose Stage File Operation list.
      • Select Yes for Configure File Reference.
      • Specify the file reference for the ZIP file downloaded from the FTP server in the Specify the File Reference section.
    2. On the Schema Options page, select XML schema (XSD) document.
    3. On the Format Definition page, configure the following options:
      • Click Browse to upload the archive of the schemas (XSDs) that represents the message structure.
      • Select the root element that contains the repeated element.
      • Click the Edit icon to select the repeating batch element in the Expression Builder.

      The Summary page shows your selections.

  4. Add a second stage file action to write the records in comma-separated value (CSV) format.
    1. On the Configure Operation page, configure the following options:
      • Select Write File from the Choose Stage File Operation list.
      • Specify the file name of the CSV file in the Specify the File Name section.
      • Specify the output directory in the Specify the Output Directory section.
      • Select the Append to Existing File check box.
    2. On the Schema Options page, select Sample delimited document (e.g. CSV).
    3. On the Format Definition page, configure the following options:
      • Click Browse to select the sample CSV file.
      • Specify the record and record set name.
  5. Perform the mapping between the two stage file actions.
  6. Add a second FTP Adapter to write the staging file to an output directory on a remote FTP site.
  7. Design the remaining parts of the integration.