Table of Contents

Search

  1. Preface
  2. Introduction
  3. Dashboard
  4. Resources
  5. Workflows
  6. Task Reference
  7. Services Overview
  8. Users
  9. Logs and Reports
  10. Encryption
  11. System
  12. Appendix
  13. Glossary Terms

Example 1: Read XML File

Example 1: Read XML File

Follow the steps below to read a XML file and load the data into a RowSet. The following page shot represents the input file:
  1. From within the Project Designer page, expand the Data Translation folder in the Component Library, and then drag the Read XML task to the Project Outline.
  2. On the Basic tab of the Read XML task, specify values for the File attribute:
    File
    The file path and file name of the XML file to read.
  3. When complete, click the
    Add
    button and select
    RowSet
    .
  4. On the Basic tab of the RowSet element, specify a value for the Variable Name attribute:
    Variable Name
    The name of a variable which will contain the parsed data. The variable will be of type RowSet and may be used in subsequent tasks that accept a RowSet input variable.
  5. When complete, click the
    Add
    button and select to add a Column.
  6. On the Basic tab of the Column element, specify values for the following attributes:
    Index
    The index of the column in the input file(s). The first column starts with index 1.
    Value
    The path to the element or attribute from which this column should draw data. To retrieve data from an element, the element path should be defined like "/Element1/Element2/Element3". To retrieve data from an attribute, the attribute should be defined like "Element1/Element2/@Attribute".
  7. When complete, click the
    Add
    button and select to add another Column
  8. On the Basic tab of the Column element, specify values for the following attributes:
    Index
    The index of the column in the input file(s). The next column is index 2.
    Value
    The path to the element or attribute from which this column should draw data. To retrieve data from an element, the element path should be defined like "/Element1/Element2/Element3". To retrieve data from an attribute, the attribute should be defined like "Element1/Element2/@Attribute".
  9. Click the
    Add
    button in the sub-menu and select the Add Same. Repeat steps 6-9 for each attribute or element you wish to retrieve.
  10. Click the
    Save
    button when finished.
The following image illustrates the Project Outline for the Read XML task, and contains columns for each element and attribute read from the XML file:
The following table illustrates the data contained in the RowSet variable created from the XML Read task:
${myData} RowSet Variable
${myData[1]}
${myData[2]}
${myData[3]}
${myData[4]}
${myData[5]}
${myData[6]}
34594
Heather
Banks
1998-01-19
BB001
72000
34593
Tina
Young
2010-04-01
BB001
65000

0 COMMENTS

We’d like to hear from you!