3.2.0

Displaying certian nodes of xml in grid ---help

Good day,

Great product!!! I am having trouble with pne part though. I need to parse an xml file and only display certain parts in the grid. For example if my xml is:

<Results>
<query>
<fname>john</fname>
<lname>jones</lname>
<query>

<Nav>
<Count>1</Count>
<nextlink></nextlink>
<prevlink></prevlink>
</Nav>
<searchresults>
<result>
<LastName>Jones</LastName>
<FirstName>John</FirstName>
<account>123456</account>
<Accountbalance>456.67</Accountbalance>
<pastdue>20days</pastdue>
<street>1101 example st</street>
<city>Charlotte</city>
<state>NC</state>
<zip>12345</zip>
<phones>
<phone>5551212</phone>
<phone>5551313</phone>
</phones>
<result>
</searchresults>
</Results>

I only want to display the First name Last name and phone numbers in the grid.

henry
April 1,
First, make sure your XML is valid (try to open it in IE). Then specify XPath for rows and columns -

table.setRows("//result");
    table.setColumns(["FirstName", "LastName", "phones/phone[1]", "phones/phone[2]"]);


See also code examples in /examples/grid data - xml
Alex (ActiveWidgets)
April 3,

This topic is archived.

See also:


Back to support forum