Related post https://help.zoho.com/portal/en/community/topic/help-with-xml
Here's the next xml do-dad I need to tackle (yes, it's for my Amazon SES+ZOHO app)
- <GetSendStatisticsResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
- <GetSendStatisticsResult>
- <SendDataPoints>
- <member>
- <DeliveryAttempts>2</DeliveryAttempts>
- <Timestamp>2011-04-17T12:25:00Z</Timestamp>
- <Rejects>0</Rejects>
- <Bounces>0</Bounces>
- <Complaints>0</Complaints>
- </member>
- <member>
- <DeliveryAttempts>16</DeliveryAttempts>
- <Timestamp>2011-04-17T09:55:00Z</Timestamp>
- <Rejects>0</Rejects>
- <Bounces>0</Bounces>
- <Complaints>0</Complaints>
- </member>
- </SendDataPoints>
- </GetSendStatisticsResult>
- <ResponseMetadata>
- <RequestId>33aeb2b9-68f8-11e0-b615-9ba76660ea6c</RequestId>
- </ResponseMetadata>
- </GetSendStatisticsResponse>
I can do this brute-force method:
- MAP={ "KEY" : "LIST" };
- XMAP = postUrl("http://some url to a php file",MAP);
- MYLIST1=(XMAP.toXML().executeXPath("//:DeliveryAttempts/text()").toXmlList()).toString().toList();
- MYLIST2=(XMAP.toXML().executeXPath("//:Timestamp/text()").toXmlList()).toString().toList();
- MYLIST3=(XMAP.toXML().executeXPath("//:Rejects/text()").toXmlList()).toString().toList();
- MYLIST4=(XMAP.toXML().executeXPath("//:Bounces/text()").toXmlList()).toString().toList();
- MYLIST5=(XMAP.toXML().executeXPath("//:Complaints/text()").toXmlList()).toString().toList();
But what I'd really like to do is get this in a form that enables generating a table in an html view, like
- HTML_TABLE = "<table width='400' border='1' cellpadding='1' cellspacing='1'><tbody><tr><td>DeliveryAttempts</td><td>Timestamp</td><td>Rejects</td><td>Bounces</td><td>Complaints</td></tr>";
- for each element in XMAP
- {
- HTML_TABLE = HTML_TABLE + "<tr><td>"+element.DeliveryAttempts+"</td><td>"+element.Timestamp+"</td><td>"+element.Rejects+"</td><td>"+element.Bounces+"</td><td>"+element.Complaints+"</td></tr>";
- }
- HTML_TABLE = HTML_TABLE + "</tbody></table>";
Even better would be to order by the time-stamp!