I am using an x:forEach to loop through an XML object to extract data
In the x:forEach I am using x:set to select the values I want.
<x:forEach var="data" select="$path/">
<x:set var="dataPoint" select="string($data//cell[8]/text())" /> ...
As you can see, I am selecting the text within the specified node and then casting it into a string. The dataPoint variables are in fact numbers, and I need to do certain things to them such as sorting and extracting the min and max amounts.
The problem is I am trying to form an Array of integers and my compiler is complaining that I cannot convery an Object into an int.
The error is: ” Type mismatch: cannot convert from Object to int “
Any thoughts?
Thanks
Solution:
I cast the Object into a String and then from a String to an integer: