3.2.0

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
December 6,
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
December 6,

This topic is archived.

See also:


Back to support forum