:: Forum >>
AW.XML.Table experts? Working with XML data.
<rows>
<row>
<attribute name="IP">
<value>1.0.0.1</value>
</attribute>
<attribute name="DNS_RNAME">
<value>www</value>
<value>ftp</value>
</attribute>
<attribute name="DNS_RTYPE">
<value>AREC</value>
<value>CNAME</value>
</attribute>
</row>
</rows>
I have the XML block above that I loaded dynamically into a AW.XML.Table object. Does anyone know how I can walk through the valueentries of for example <attribute name="DNS_RNAME"> and display each entry?
For example in a simple for(var i= ..... loop.
Karl Thoroddsen
Tuesday, December 6, 2005
Trial and error finally cracked it:
table.setRows("//result/rows/row/attribute[@name='DNS_RNAME']/value");
table.setColumns(["."]);
table.setXML(xml);
for (var i = 0; i < table.getCount(); i++)
{
alert(table.getValue(0,i));
}
setXML must be called after setRows and setColumns.
Karl Thoroddsen
Tuesday, December 6, 2005
This topic is archived.
Back to support forum
Forum search