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: Write XML File

Example 1: Write XML File

The input RowSet data used in this example is based on the example data as it appears in the RowSet topic. Follow the steps below to write the XML file.
  1. From within the Project Designer page, expand the Data Translation folder in the Component Library, and then drag the Write XML task to the Project Outline.
  2. On the Basic tab of the Write XML task, specify the Output File value:
    Output File
    The file path and file name of the XML file to write.
  3. In the Write XML task window, from the
    Add
    button in the sub-menu, click
    Element
    . The first Element in the Project Outline will become the root node in the XML document.
  4. On the Basic tab of the Element, specify a value for the following attributes:
    Name
    The element name as it will appear in the output XML file. An element is an XML tag. For example, <tagName>.
    Enclose in CDATA
    Whether or not the text in the Value attribute should be wrapped in CDATA tags.
  5. In the Element window, from the
    Add
    button in the sub-menu, click
    For-Each
    . The XML Write task's For-Each element iterates through each row in a RowSet variable.
  6. On the Basic tab of the For-Each element, specify the Input RowSet Variable value:
    Input RowSet Variable
    The name of a variable of type RowSet which contains data to write to a file. For example, ${variableName}.
  7. In the For-Each window, from the Add link in the sub-menu, click
    Element
    .
  8.  On the Basic tab for the Element, specify the Name value:
    Name
    The element name as it will appear in the output XML file. An element is an XML tag. For example, <tagName>.
  9. In the Element window, from the
    Add
    button in the sub-menu, click
    Attribute
    .
  10. On the Basic tab of the Attribute element, specify values for the following attributes:
    Name
    The attribute name as it will appear in the output XML file. For example, <element attributeName="attributeValue" />.
    Value
    The value of this attribute. This may be expressed by a combination of constant values and RowSet column references. For example ${RowSetVariable[2]}, where RowSetVariable is the name of the variable of type RowSet and 2 is the column index of that RowSet. Please note that only RowSets which are in use by a parent For-Each element may be used.
  11. From the Project Outline, select the element above the attribute, and from the Add link in the sub-menu, click
    Element
    .
  12. On the Basic tab of the Element, specify a value for the following attributes:
    Name
    The element name as it will appear in the output XML file. An element is an XML tag. For example, <tagName>.
    Enclose in CDATA
    Whether or not the text in the Value attribute should be wrapped in CDATA tags.
  13. If needed, add additional Attributes, from the Add link in the sub-menu by selecting the
    Add Same
    option. Repeat step 11 for each attribute.
  14. Click the
    Save
    button when finished.
    The following image illustrates the Project Outline for the Write XML task:
    The following image illustrates the XML file created from the Write XML task:

0 COMMENTS

We’d like to hear from you!