How do I extract data from an XML file and use it in my ECL program?

53 views Asked by At

I have been trying to import data from an XML file into my ECL code for some processing. However, I am encountering the following error messages: Error messages encountered

Here is the XML data I am trying to read: XML data

Here is a screenshot of the Spraying operation:XML File Spray

Here is the ECL code used: ECL code

I have tried to read the data in the file, however I have encountered the above specified error messages. I do not know if this is because I sprayed the data incorrectly into the HPCC cluster or if there is some other problem in my ECL code.

Therefore, I require a series of steps on spraying XML data into the HPCC cluster as well as the appropriate ECL code to read and display the data. If any mistakes are present in my approach, corrections would be greatly appreciated.

1

There are 1 answers

0
Richard Taylor On

This question is directly answered by a class exercise in our Advanced ECL Part 2 course, the only difference is your "timezones" file tag instead of the "Dataset" tag in the file for the course.

Here's your example code:

r := RECORD
  INTEGER2  code;
  STRING110 description;
  STRING42  zone;
END;
d := DATASET('~CLASS::BMF::IN::timezones',r,XML('timezones/area'));
OUTPUT(d);

HTH,

Richard