Project: Read Data from an XML File

This scenario demonstrates how to read information stored in an XML file and populate a list variable so that the data can be used within an automation solution.

For information about XML variable types and their methods, see here.

Scenario Overview

In this scenario, the solution reads the information included in the XML file shown below. This file includes data on three different members of a country club.

The solution will populate a list variable with the member data. Once XML data has been inserted into a list variable, it can then be used by an automation solution, for example, to write data to an Excel file or display it to an agent in a callout.

Download Project Files

  1. Download the project file here.

  2. Unzip and copy the files to the folder %AppData%/Nice_Systems/AutomationStudio/Projects.

  3. Download the XML file here.

  4. Unzip and copy the XML file to the folder c:/Temp.

Recommended Implementation Approach

This scenario follows the implementation steps below:

  1. Load the XML file into an XML document variable.

  2. Extract the root node of the XML document into an XML element variable.

  3. Extract the member nodes of the XML element and store them in an XML nodes list variable.

  4. Extract information from each XML node to populate one element of a member list variable.

  5. Test the solution.

Implementation

The video below demonstrates the full implementation of the project solution.