Problem Reading XML Files
Posted: Tue Nov 04, 2014 2:53 pm
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 ------------------
com.linoma.dpa.tasks.xmlread.XMLRowSet@6f8c468f
11/4/14 2:51:38 PM INFO Finished task 'print 1.0'
My simple project looks like this.
ettings>
<archiving>
<daystokeep>30</daystokeep>
</archiving>
<alerts>
<alert name="filenotfound">
<threshold>
<interval>1</interval>
<duration>day</duration>
</threshold>
<notification>
<email>[email protected]</email>
</notification>
</alert>
</alerts>
</settings>
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 ------------------
com.linoma.dpa.tasks.xmlread.XMLRowSet@6f8c468f
11/4/14 2:51:38 PM INFO Finished task 'print 1.0'
My simple project looks like this.
Code: Select all
My XML file is simple.<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" />
</rowset>
</xmlRead>
<print version="1.0">
<![CDATA[------------------
${xmlData}
------------------]]>
</print>
</module>
</project>
ettings>
<archiving>
<daystokeep>30</daystokeep>
</archiving>
<alerts>
<alert name="filenotfound">
<threshold>
<interval>1</interval>
<duration>day</duration>
</threshold>
<notification>
<email>[email protected]</email>
</notification>
</alert>
</alerts>
</settings>