I have an xml file that has two rowsets, each of them contains data to display a grid:
<?xml version="1.0" encoding="utf-8"?>
<Rowsets>
<Rowset id="1">
<Columns>
<Column align="center" format="" hidden="false" sort="str" type="ro" width="80" id="ID" Description="Id"/>
<Column align="center" format="" hidden="false" sort="str" type="ro" width="80" id="DATE" Description="Date"/>
<Column align="center" format="" hidden="false" sort="str" type="ro" width="80" id="TIME" Description="Time"/>
</Columns>
<Row>
<ID>685</ID>
<DATE>2014-09-11</DATE>
<TIME>11:10</TIME>
</Row>
<Row>
<ID>686</ID>
<DATE>2014-09-11</DATE>
<TIME>12:34</TIME>
</Row>
</Rowset>
<Rowset id="2">
<Columns>
<Column align="center" format="" hidden="false" sort="str" type="ro" width="80" id="ID" Description="Id"/>
<Column align="center" format="" hidden="false" sort="str" type="ro" width="80" id="MIN" Description="Minimum"/>
<Column align="center" format="" hidden="false" sort="str" type="ro" width="80" id="MAX" Description="Maximum"/>
</Columns>
<Row>
<ID>688</ID>
<MIN>11.48</MIN>
<MAX>17.23</MAX>
</Row>
<Row>
<ID>689</ID>
<MIN>12.03</MIN>
<MAX>18.67</MAX>
</Row>
</Rowset>
</Rowsets>
To be able to display output of the first Rowset as a grid I load data using Ajax, then when I get a response I take a part of it with
var firstRowset = $(result).find('Rowset:eq(0)');
And then I have a problem. No matter which function I use to load xml for grid it goes into error:
testGrid.loadXMLString(firstRowset); /* Error: Unable to get property 'replace' of undefined or null reference] */
testGrid.parse(firstRowset); /* Error: Object doesn't support property or method 'getElementsByTagName' */
testGrid1.loadXML(firstRowset); /* Error: Object doesn't support property or method 'indexOf' */
testGrid1.load(firstRowset); /* Error: Object doesn't support property or method 'indexOf' */
Do I miss something important? Or maybe there is a better approach? Or is it not possible to work with such a file?
Any help will be very appreciated!