Page 1 of 1

Problem Reading XML Files

Posted: Tue Nov 04, 2014 2:53 pm
by TViens
Assistance please. I have been trying to read in fields from and XML file. In the log the variables for the fields are assigned odd values. I also tried using a template and modifying it read a simple XML file. Values from the XML are not returned the way that I expected.

I get interesting output in the log files when trying to read the values out.

11/4/14 2:51:38 PM INFO Data parsed successfully and the rowset variable(s) 'xmlData' were created
11/4/14 2:51:38 PM INFO Finished task 'xmlRead 1.0 (Read XML File)'
11/4/14 2:51:38 PM INFO Executing task 'print 1.0'
11/4/14 2:51:38 PM INFO ------------------
[email protected]
11/4/14 2:51:38 PM INFO Finished task 'print 1.0'

My simple project looks like this.
Code: Select all
<project name="xml3" mainModule="Main" version="2.0" logLevel="verbose">

	<module name="Main">

		<xmlRead label="Read XML File" file="/data/cloverleaf_test/test_ftp/settings.xml" defaultDateFormat="yyyy-MM-dd" defaultTimeFormat="HH:mm:ss" defaultTimestampFormat="MM/dd/yyyy HH:mm:ss.SSS" version="1.0">
			<rowset name="xmlData">
				<column index="1" value="/settings/archiving/daystokeep" name="COLUMN1" type="INTEGER" />
				<column index="2" value="/settings/archiving/daystokeep" name="COLUMN2" type="CHAR" />
				<column index="3" value="/settings/archiving/daystokeep" name="COLUMN3" type="DATE" />

		<print version="1.0">



My XML file is simple.
<alert name="filenotfound">
<email>[email protected]</email>


Re: Problem Reading XML Files

Posted: Mon Nov 10, 2014 12:56 pm
by Support_Rick

Just do a ForEach over the Rowset that has been read then address each Field as a sub-value of that rowset...

ForEach ${XMLData} -- ThisRec
SetVariable ... Days2Keep = ${ThisRec[1]}