How to get the value-of the node dynamically?
Hi all,
I have an XML that is generated dynamically (at runtime), so the number of sub nodes (subnode here is column) is not defined earlier.
In the following example, the xPath rowSet/row/column is defined at run time.
My requirement is to get the values of the node column whose names vary from wh.actual0 to wh.actual3 (in our case, we have 4 column nodes.).
I tried appending the numbers to the name of the column, but that doesn't work out.
How to get the values of those columns?
Waiting for the reply...
<rowSet>
<row num="0">
<column name="wh.seriesName" indexed="false">Prius</column>
<column name="wh.actualTotal" indexed="false">13230</column>
<column name="wh.actual0" indexed="true">300</column>
<column name="wh.actual1" indexed="true">300</column>
<column name="wh.actual2" indexed="true">3200</column>
<column name="wh.actual3" indexed="true">300</column>
</row>
<row num="1">
<column name="wh.seriesName" indexed="false">Camry</column>
<column name="wh.actualTotal" indexed="false">13230</column>
<column name="wh.actual0" indexed="true">300</column>
<column name="wh.actual1" indexed="true">300</column>
<column name="wh.actual2" indexed="true">300</column>
<column name="wh.actual3" indexed="true">300</column>
</row>
</rowSet>
Last edited by sayanand; December 17th, 2008 at 04:43 AM..
|